## Initializing Stripe.js

`Stripe(publishableKey: string, options?: object)`

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](https://docs.stripe.com/keys.md) is required when calling this function, as it identifies your website to Stripe.

We've prefilled the example with a sample [test API key](https://docs.stripe.com/keys.md). Don’t submit any personally identifiable information in requests made with this key.
To create a Stripe object using your account, replace the sample API key with your actual API key or [sign in](https://docs.stripe.com/login.md?redirect=%2Fdocs%2Fjs%2Finitializing).


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](https://docs.stripe.com/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`
  Your publishable key.

- `options`
  Initialization options.
    - `stripeAccount`
      For usage with [Connect](https://docs.stripe.com/connect.md) only.
Specifying a connected account ID (e.g., `acct_24BFMpJ1svR5A89k`) allows you to perform actions on behalf of that account.
    - `apiVersion`
      Override your account's [API version](https://docs.stripe.com/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`
      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`
      Stripe.js developer tooling options.
      - `assistant`
        Stripe Elements sandbox assistant options.
        - `enabled`
          Set to `false` to disable the sandbox assistant UI.
Defaults to `true` when using [Elements with the Checkout Sessions API](https://docs.stripe.com/checkout/custom/quickstart.md) or when using [Elements with the Payment Intents API](https://docs.stripe.com/payments/quickstart.md) on version Clover or above.

### Example

```title
Initializing Stripe.js
```
