## Including Stripe.js Include the Stripe.js script on each page of your site—it should always be loaded directly from `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](/disputes/prevention/advanced-fraud-detection.md) 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](https://github.com/stripe/stripe-js). **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.](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/What_is_JavaScript#script_loading_strategies) 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](/sdks/stripejs-versioning.md). ### Including Stripe.js ```html ```