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
| Parameter | Type | Description | Default | Required |
|---|---|---|---|---|
mode | production | sandbox | Environment to use | production | No |
Usage examples
Production environment
import { RevolutIdLoader } from '@revolut/revolut-id'
const revolutId = await RevolutIdLoader({ mode: 'production' })
Sandbox environment
import { RevolutIdLoader } from '@revolut/revolut-id'
const revolutId = await RevolutIdLoader({ mode: 'sandbox' })
Default mode
import { RevolutIdLoader } from '@revolut/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.