# RevolutIdLoader interface

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

## Type definition

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

type RevolutIdLoaderParams = {
  mode?: Mode
}
```

## Parameters

| Parameter | Type                               | Description        | Default      | Required |
| --------- | ---------------------------------- | ------------------ | ------------ | -------- |
| `mode`    | <code>production \| sandbox</code> | Environment to use | `production` | No       |

## Usage examples

### Production environment

```typescript
import { RevolutIdLoader } from '@revolut/id'

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

### Sandbox environment

```typescript
import { RevolutIdLoader } from '@revolut/id'

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

### Default mode

```typescript
import { RevolutIdLoader } from '@revolut/id'

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

## Error handling

```typescript
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.