## Initialize embedded Checkout This method initializes embedded Checkout. This method returns a `Promise` which resolves with an embedded Checkout instance. **Syntax:** `stripe.initEmbeddedCheckout(...)` - `options` (object) **required** Embedded Checkout initialization options. - `fetchClientSecret` (function) **required** A callback function `fetchClientSecret() => Promise` that resolves with the [client secret](/api/checkout/sessions/object.md#checkout_session_object-client_secret) for the [Checkout Session](docs/api/checkout/sessions/object). - `clientSecret (deprecated)` (string) **required** _This param has been deprecated in favor of the `fetchClientSecret` param, which offers a faster loading experience._ The [client secret](/api/checkout/sessions/object.md#checkout_session_object-client_secret) for the [Checkout Session](docs/api/checkout/sessions/object). - `onComplete` (function) An optional callback function `onComplete() => void` that is called on completion for Checkout Sessions with `redirect_on_completion: if_required`. ### Initialize embedded Checkout ```es_next const fetchClientSecret = async () => { const clientSecret = await createCheckoutSession(); return clientSecret; }; const checkout = await stripe.initEmbeddedCheckout({ fetchClientSecret, }); ```