Installation


Welcome to the Ngx Stripe installation guide. This guide provides detailed instructions for integrating Ngx Stripe into your Angular project, ensuring you're set up for a smooth implementation.

Prerequisites

Before proceeding with the installation, make sure to note the following prerequisites:

  • Angular Version Compatibility: Ngx Stripe major versions are aligned with Angular versions. For Angular version 19, use Ngx Stripe version 19
  • StripeJS Peer Dependency: ngx-stripe requires @stripe/stripe-js as a peer dependency for types:
        $ npm install ngx-stripe @stripe/stripe-js
      

To install an specific version for an older Angular major, use the lts npm tags or check the table below to pick the right version, for example, for v16:

        $ npm install ngx-stripe@v16-lts @stripe/stripe-js
      

Important Notes

  • Major Update in @stripe/stripe-js v2: Be aware that @stripe/stripe-js has undergone significant changes from v1 to v2. While these changes are major, the breaking changes are minimal. ngx-stripe will maintain its release cycle independent of these changes. Review the @stripe/stripe-js v2 documentation to ensure full compatibility with your project.
  • Lazy Loading of StripeJS: ngx-stripe efficiently handles the lazy loading of StripeJS, meaning you don't need to add it manually to your project. If StripeJS is detected in your environment, ngx-stripe will not load it again, preventing duplicate instances.
  • Direct Loading of StripeJS: Should you opt to load StripeJS directly, always use the Stripe CDN. Do not store a local copy of StripeJS, as it's important to use the most secure and up-to-date version for payment processing security and compliance.

Table Versions

Angularngx-stripe
1919.x+
1818.x+
1717.x+
1616.x+
1515.x+
1414.x+
1313.x+
1212.x+
1111.x+
1010.x+
9v9-lts / 9.4.0
8v8-lts / 8.2.0