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 methodReferenceIntegration guide
Embedded checkoutSDK referenceGuide

Payment methods available:

  • Card, Revolut Pay, Apple Pay, Google Pay, Pay by Bank (configured via Revolut Business)

Type signature

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

Parameters

ParameterDescriptionTypeRequired
publicTokenYour Merchant API public key.stringYes
modeAPI environment. Default: 'prod''prod' | 'sandbox'No
localeWidget 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.

Returns

Returns a Promise<EmbeddedCheckoutInstance> with the following methods:

interface EmbeddedCheckoutInstance {
destroy: () => void
}
  • destroy - Manually destroy the instance and remove the widget from the page

Example

import RevolutCheckout from '@revolut/checkout'

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