# flowstudio-rn

> React Native SDK for Bureau Flow Studio: run Flow Studio identity and verification journeys in React Native apps, with or without Expo.

Latest version **0.0.2-alpha** (published 2026-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install flowstudio-rn
pnpm add flowstudio-rn
yarn add flowstudio-rn
bun add flowstudio-rn
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.2-alpha |
| Published | 2026-09-24 |
| First published | 2026-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Bureau |
| Maintainers | bureauid-fraud |
| Keywords | react-native, expo, bureau, flowstudio, identity-verification, kyc |

## Links

- npm: https://www.npmjs.com/package/flowstudio-rn
- Repository: https://github.com/deepak-bureau/flowstudio-react-native-sdk
- Homepage: https://github.com/deepak-bureau/flowstudio-react-native-sdk#readme
- Issues: https://github.com/deepak-bureau/flowstudio-react-native-sdk/issues
- npm.io page: https://npm.io/package/flowstudio-rn

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.2-alpha (latest) — 2026-09-24
- 0.0.3-alpha (alpha) — 2026-09-24
- 0.0.1-alpha — 2026-09-23

## README

# flowstudio-rn

React Native SDK for Bureau Flow Studio. It runs Flow Studio identity and verification journeys inside React Native.

> **Alpha:** Android only for now. iOS support is coming. On iOS, `initialize()` and `start()` throw `FlowStudio: ios is not supported yet`, and `isInitialized()` returns `false`.

## Installation

```sh
npm install flowstudio-rn@alpha
```

Expo projects can use `npx expo install flowstudio-rn@alpha`.

Rebuild the app after installing (`npx react-native run-android`, or `npx expo run:android` for Expo). Expo Go is not supported.

**Requirements:**

- React Native 0.81 or newer, or Expo SDK 54 or newer. Their default Android build setup (Android Gradle Plugin, Gradle, `compileSdkVersion` 36) works as is.
- `minSdkVersion` 24 or higher (the React Native 0.81+ default).
- The SDK declares the `CAMERA` permission, which it uses for document capture and liveness.

### Android setup

The SDK registers this repository for your app automatically:

- **Expo (prebuild / CNG):** add the config plugin to `app.json`, then run `npx expo prebuild` (or `npx expo run:android`):

  ```json
  {
    "expo": {
      "plugins": ["flowstudio-rn"]
    }
  }
  ```

- **Bare React Native:** nothing to add. The library's Gradle file registers the repository for all projects.

If your `settings.gradle` sets `repositoriesMode` to `FAIL_ON_PROJECT_REPOS`, add the repository yourself under `dependencyResolutionManagement { repositories { ... } }`:

```groovy
maven { url "https://packages.bureau.id/api/packages/Bureau/maven" }
```

## API Reference

```typescript
import { FlowStudio } from 'flowstudio-rn';
```

### `FlowStudio.initialize(config)`

Initializes the SDK. Call it before `start()`, for example once you have created the execution on your backend.

**Parameters (`FlowStudioConfig`):**

- `credentialId` (string): your Bureau credential ID
- `deviceCredentialId` (string): credential ID used for device intelligence
- `executionId` (string): ID of the Flow Studio execution to run
- `environment` (string, optional): `'PROD'`, `'STAGING'` or `'DEV'` (default: `'PROD'`)
- `enableLogging` (boolean, optional): enables SDK logs (default: `false`)

It throws an `Error` if a required field is missing or `environment` is invalid.

### `FlowStudio.start()`

Opens the Flow Studio journey. The promise resolves when the journey ends.

**Returns:** `Promise<FlowStudioResult>`

```typescript
type FlowStudioResult =
  | { type: 'result'; response: ExecutionResponse } // journey finished
  | { type: 'exit' }; // user left the journey without a result

interface ExecutionResponse {
  executionId: string;
  merchantId: string;
  requestId: string;
  executionStatus: string; // 'PROCESSING' | 'AWAITING' | 'COMPLETED' | 'TIMEOUT' | 'ERROR'
  currentState: Record<string, unknown>;
  createdAt: number; // epoch timestamp
  updatedAt: number; // epoch timestamp
}
```

Only one journey can run at a time. `start()` can be called again once the previous call has resolved.

### `FlowStudio.isInitialized()`

**Returns:** `boolean`, which is `true` once `initialize()` has succeeded.

## Usage Example

```typescript
import { FlowStudio } from 'flowstudio-rn';

async function runVerification(executionId: string) {
  FlowStudio.initialize({
    credentialId: 'your-credential-id',
    deviceCredentialId: 'your-device-credential-id',
    executionId,
    environment: 'STAGING', // 'PROD' for live
  });

  try {
    const result = await FlowStudio.start();

    if (result.type === 'result') {
      console.log('Status:', result.response.executionStatus);
    } else {
      console.log('User exited the journey');
    }
  } catch (error) {
    console.error('FlowStudio failed:', error);
  }
}
```

## Errors

`initialize()` and `start()` throw or reject with an `Error`. Errors from `start()` that come from the SDK carry a `code`:

| Code | Meaning |
|---|---|
| `ERR_ALREADY_STARTED` | `start()` was called while a journey is already running |
| `ERR_START_FAILED` | The SDK failed to start the journey (see `message`) |
| `ERR_MODULE_DESTROYED` | The app reloaded or the React context was torn down during a journey |

If the native module is missing (for example the app was not rebuilt after installing the package, or it runs in Expo Go), calls throw `FlowStudio: native module not found`.

## Notes

- **Execution ID:** create a new execution for each journey. Execution IDs are single use.
- **Environment:** use `'STAGING'` for testing and `'PROD'` for live traffic. Credentials are environment specific.
- **Exit handling:** a `{ type: 'exit' }` result is not an error. It means the user closed the journey.

## License

MIT

---
_Source: https://npm.io/package/flowstudio-rn · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
