## Initializing Stripe.js Use `Stripe(publishableKey, options?)` to create an instance of the **Stripe object**. The Stripe object is your entrypoint to the rest of the Stripe.js SDK. Your Stripe publishable [API key](/keys.md) is required when calling this function, as it identifies your website to Stripe. When you’re ready to accept live payments, replace the test key with your live key in production. Learn more about how API keys work in [test mode and live mode](/dashboard.md#viewing-test-data). When you use the same publishable API key and options, create and share a single instance of the Stripe object. Creating multiple instances might lead to performance issues. - `publishableKey` (string) **required** Your publishable key. - `options` (object) Initialization options. - `stripeAccount` (string) For usage with [Connect](/connect.md) only. Specifying a connected account ID (e.g., `acct_24BFMpJ1svR5A89k`) allows you to perform actions on behalf of that account. - `apiVersion` (string) Override your account's [API version](/api/versioning.md). **This option is only available on Stripe.js v3.** For versions after `v3` such as `acacia`, the API version is [pinned to the Stripe.js version](https://docs.stripe.com/sdks/stripejs-versioning#compatibility-with-api-versions). - `locale` (string) A [locale](#supported_locales) used to globally configure localization in Stripe. Setting the locale here will localize error strings for all Stripe.js methods. It will also configure the locale for [Elements](#element_mount). Default is `auto` (Stripe detects the locale of the browser). - `developerTools` (object) Stripe.js developer tooling options. - `assistant` (object) Stripe Elements sandbox assistant options. - `enabled` (boolean) Set to `false` to disable the sandbox assistant UI. Defaults to `true` when using [Elements with the Checkout Sessions API](/checkout/custom/quickstart.md) or when using [Elements with the Payment Intents API](/payments/quickstart.md) on version Clover or above. ### Initializing Stripe.js ```js var stripe = Stripe('{TEST_PUBLISHABLE_KEY}'); ``` ```es_next const stripe = Stripe('{TEST_PUBLISHABLE_KEY}'); ```