Sandbox
Help

RevolutIdLoader interface

RevolutIdLoader is main entry point for loading the Revolut ID SDK.

Type definition

type RevolutIdLoader = (params?: RevolutIdLoaderParams) => Promise<RevolutId>

type RevolutIdLoaderParams = {
  mode?: Mode
}

Parameters

ParameterTypeDescriptionDefaultRequired
modeproduction | sandboxEnvironment to useproductionNo

Usage examples

Production environment

import { RevolutIdLoader } from '@revolut/id'

const revolutId = await RevolutIdLoader({ mode: 'production' })

Sandbox environment

import { RevolutIdLoader } from '@revolut/id'

const revolutId = await RevolutIdLoader({ mode: 'sandbox' })

Default mode

import { RevolutIdLoader } from '@revolut/id'

// Uses production mode by default
const revolutId = await RevolutIdLoader()

Error handling

try {
  const revolutId = await RevolutIdLoader({ mode: 'production' })
  // SDK loaded successfully
} catch (error) {
  console.error('Failed to load Revolut ID SDK:', error)
  // Handle loading failure
}

Return value

Returns Promise<RevolutId> resolving to the main SDK interface for authentication client initialisation.

Rate this page