# Direct initialisation

Initialise the SDK with your public API key to access the embedded checkout widget with all payment methods.

Direct initialisation creates an `EmbeddedCheckoutInstance` with unified payment methods. Use this method when you want all payment methods in one widget and create orders on-demand during checkout.

| Payment method    | Reference                                                                      | Integration guide                                                          |
| ----------------- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
| Embedded checkout | [SDK reference](/docs/sdks/merchant-web-sdk/payment-methods/embedded-checkout) | [Guide](/docs/guides/merchant/accept-payments/online-payments/revolut-checkout/web) |

**Payment methods available:**

- Card, Revolut Pay, Apple Pay, Google Pay, Pay by Bank (configured via [Revolut Business](https://business.revolut.com/settings/checkout/payment-methods))

## Type signature

```typescript
RevolutCheckout.embeddedCheckout(options: {
  publicToken: string
  mode?: 'prod' | 'sandbox'
  locale?: Locale | 'auto'
}): Promise<EmbeddedCheckoutInstance>
```

## Parameters

| Parameter     | Description                        | Type                  | Required |
| ------------- | ---------------------------------- | --------------------- | -------- |
| `publicToken` | Your Merchant API public key.      | `string`              | Yes      |
| `mode`        | API environment. Default: `'prod'` | `'prod' \| 'sandbox'` | No       |
| `locale`      | Widget language. Default: `'auto'` | `Locale \| 'auto'`    | No       |

:::tip
The `mode` parameter must match the environment used for your public API key. Production keys work only in `'prod'` mode, and sandbox keys only in `'sandbox'` mode.
:::

For additional configuration options including `target`, `createOrder`, callbacks, and customer details, see the [Embedded checkout reference](/docs/sdks/merchant-web-sdk/payment-methods/embedded-checkout).

## Returns

Returns a `Promise<EmbeddedCheckoutInstance>` with the following methods:

```typescript
interface EmbeddedCheckoutInstance {
  destroy: () => void
}
```

- **`destroy`** - Manually destroy the instance and remove the widget from the page

## Example

```typescript
import RevolutCheckout from '@revolut/checkout'

const { destroy } = await RevolutCheckout.embeddedCheckout({
  publicToken: 'pk_...',
  mode: 'prod',
  locale: 'auto',
})
```