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
Angular | ngx-stripe |
---|---|
19 | 19.x+ |
18 | 18.x+ |
17 | 17.x+ |
16 | 16.x+ |
15 | 15.x+ |
14 | 14.x+ |
13 | 13.x+ |
12 | 12.x+ |
11 | 11.x+ |
10 | 10.x+ |
9 | v9-lts / 9.4.0 |
8 | v8-lts / 8.2.0 |