@paypal/messaging-components

PayPal messaging library for integrating PayPal Credit messaging on merchant websites

Usage no npm install needed!

<script type="module">
  import paypalMessagingComponents from 'https://cdn.skypack.dev/@paypal/messaging-components';
</script>

README

PayPal Credit Messaging


Build Status dependencies Status devDependencies Status

A messaging component allowing easy integration of PayPal Credit Messages onto your site.

Dev Docs

See developer.paypal.com/docs/business/pay-later/integrate/


Development

Please feel free to follow the Contribution Guidelines to contribute to this repository. PRs are welcome, but for major changes please raise an issue first.

Quick Setup

Set up your env:

npm install

Run tests:

npm test

Run in dev mode:

npm start

Scripts

  • build

  • build:<env> where <env> is stage, sandbox, or production

    • runs webpack with NODE_ENV=<env>
  • build:analyze

  • build:demo

    • runs webpack with env.demo set
  • dev

    • runs webpack-dev-server with TARGET=sdk, NODE_ENV=local, STAGE_TAG=local
  • dev:<target> where <target> is standalone, modal, or lander

    • runs webpack-dev-server with TARGET=<target>, NODE_ENV=local, STAGE_TAG=local
    • note: modal uses TARGET=standalone-modal
  • dev:<env> where <env> is stage, sandbox, or production

    • runs webpack-dev-server with TARGET=standalone and NODE_ENV=<env>
  • lint

    • checks our codebase for style issues
  • preinstall

    • runs automatically on npm install and removes node_modules/
  • start

    • runs npm run dev
  • test

    • runs all unit tests
  • test:<type> where <type> is func, func:nosnaps or func:ciupdate

    • func runs all snapshot functional tests
    • func:nosnaps runs all non-snapshot functional tests
    • func:ciupdate updates all snapshots generated by functional tests

Testing

Functional

To run functional tests, first run npm run dev:standalone in one command line instance and npm run test:func in a second command line instance. The dev:standalone command creates static pages that the functional tests are run on.

Releasing

This package is published weekly, Every Wednesday. Please view our Changelog to stay updated with bug fixes and new features.