Skip to main content
Version: v2

Set up Checkout SDK

Initialisation​

Default setupView on GitHub
// Import the checkout module from the Immutable SDK package
import { checkout } from '@imtbl/sdk';

// Instantiate the Checkout SDKs with the default configurations
export const checkoutSDK = new checkout.Checkout();

Further details on the Checkout class can be found in the Immutable SDK documentation.

Configuration​

The following properties are configurations to correctly initialise the SDKs.

PropertyDescription
baseConfigApplication base configuration that specifies the application's environment. Default environment is SANDBOX.
swapConfigure the Swap feature (e.g. enable/disable).
bridgeConfigure the Bridge feature (e.g. enable/disable).
onRampConfigure the On-Ramp feature (e.g. enable/disable).
Custom setupView on GitHub
// Import the checkout and config modules from the Immutable SDK package
import { checkout, config } from '@imtbl/sdk';

// Create a new Immutable SDK configuration

// Replace with your Publishable Key from the Immutable Hub
const PUBLISHABLE_KEY = process.env.NEXT_PUBLIC_PUBLISHABLE_KEY ?? ''

// Set the environment to SANDBOX for testnet or PRODUCTION for mainnet
const baseConfig = {
environment: config.Environment.SANDBOX,
publishableKey: PUBLISHABLE_KEY,
};

// Instantiate the Checkout SDKs with the default configurations
export const checkoutSDK = new checkout.Checkout({
baseConfig,
bridge: { enable: true },
onRamp: { enable: true },
swap: { enable: true },
// passport: <optionally add Passport instance>
});

caution

Ensure that you call await passport.connectEvm() before passing it as a config parameter to the Checkout class. This is required to initialise the Passport instance.