Including
Including Stripe.js Include the Stripe.js script on each page of your site—it should always be loaded directly from
Last verified 2026-09-24
Is this helpful?
https://js.stripe.com, rather than included in a bundle or hosted yourself. To best leverage Stripe’s advanced fraud functionality, include this script on every page, not just the checkout page. This allows Stripe to detect suspicious behavior that may be indicative of fraud as customers browse your website. Using Stripe.js as a module We also provide an npm package that makes it easier to load and use Stripe.js as a module. For more information, check out the project on GitHub. Asynchronous and deferred loading of Stripe.js Asynchronous loading of JavaScript is generally recommended, as it can improve the user experience of your site by not blocking DOM rendering during script loading. The easiest way to asynchronously load Stripe.js is to use the npm module as described above. It does asynchronous loading by default. You can also load Stripe.js using the async or defer attribute on the script tag. Note, however, that with asynchronous loading any API calls will have to be made only after the script execution has finished. Versioning The Stripe.js URL is versioned—we recommend keeping up to date with the latest version. For more information, see the Stripe.js versioning and support policy.Is this helpful?