# @getrollee/connect-react-native-sdk

> React Native SDK for Rollee Connect

Latest version **1.1.1** (published 2024-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @getrollee/connect-react-native-sdk
pnpm add @getrollee/connect-react-native-sdk
yarn add @getrollee/connect-react-native-sdk
bun add @getrollee/connect-react-native-sdk
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2024-08-19 |
| First published | 2022-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 47.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rollee |
| Maintainers | echeb, pierrick_rollee |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/@getrollee/connect-react-native-sdk
- Repository: https://npm.io/package/@getrollee/connect-react-native-sdk
- Homepage: https://npm.io/package/@getrollee/connect-react-native-sdk#readme
- Issues: https://npm.io/package/@getrollee/connect-react-native-sdk/issues
- npm.io page: https://npm.io/package/@getrollee/connect-react-native-sdk

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2024-08-19
- 1.1.0 — 2023-12-04
- 1.0.9 — 2023-06-28
- 1.0.7 — 2023-06-26
- 1.0.6 — 2023-03-20
- 1.0.5 — 2022-12-10
- 1.0.4 — 2022-12-06
- 1.0.3 — 2022-11-29
- 1.0.2 — 2022-11-24
- 1.0.0 — 2022-11-23
- 0.1.3 — 2022-09-26
- 0.1.2 — 2022-09-16
- 0.1.1 — 2022-09-16
- 0.1.0 — 2022-08-24
- 0.0.9 — 2022-08-24
- … 7 more at https://npm.io/package/@getrollee/connect-react-native-sdk/versions

## README

![RolleeLogo](https://assets.website-files.com/620a1faae71d0d7f242dcc75/620ce533a71b6033b7aaf7e8_rollee-logo-dark.svg)

# Rollee Connect React Native SDK

Rollee Connect SDK is a plugin for integrating Rollee Connect process into WEB or mobile applications.

## Change Log

### v1.1.1
- adding performance layer for Android 

### v1.1.0 
**==Breaking changes - Important!==**
- adding `customizationId` parameter to configuration
- removing `setup` parameter from configuration
- removing `token` parameter from configuration

### v1.0.6
- update configuration fixes

### v1.0.5
- onLoginSuccess callback added

### v1.0.4
- supporting multiple session customization
### v1.0.3
- bug fixing

### v1.0.2
- update documentation

### v1.0.0

**==Breaking changes - Important!==**
- you should use **`token`** instead of apiKey, parnterUUID and parnterName
- updated to typescript
- exported types

### v0.1.3

- bug fixes

### v0.1.2

- bug fixes

### v0.1.1

- added param for skipping datasources page
- added param for removing "Close button" at header
- improved "onCompleted" callback
- other bug fixes

### v0.1.0

- bug fixes

### v0.0.9

- updated React Native version to 0.68.2

### v0.0.8

- Added "datasource" param for pre-selecting data source and skip "Search" screen

### v0.0.7

- Fixed form view on software keyboard opened

### v0.0.6

- Added new callback "onClose" when user confirm closing the Rollee Connect process.

### v0.0.5

- Added support for providing sessionToken to match one session
- added sessionToken in "completed" callback
- other fixes

## Installation

Create a sample Expo project with typescript

```bash
$ expo init YourReactNativeProject -t expo-template-blank-typescript
```

Add Rollee Connect SDK

```
$ npm install --save @getrollee/connect-react-native-sdk
```

## Usage

The RolleeConnect component is a view that you can integrate into your app's flow. The CONFIG and optional callback handlers are passed in as props.

```bash
import RolleeConnect from "@getrollee/connect-react-native-sdk";
.
.
.
<RolleeConnect config={CONFIG} onCompleted={onCompleted} onClose={onClose} />
```

## Callbacks

When you want to exit from Rollee Connect back to your application or to get information when user completed flow, you should use `onClose` and `onCompleted` callbacks

```javascript
const onClose = () => {
    console.log('onClose');
};

const onCompleted = (data) => {
    console.log('onCompleted', data);
};
```


## Configuration

To define a User Session on Rollee Connect, you must provide the mandatory parameter `sessionToken`.

The `production` and `customizationId` parameters are optional.

If `production` parameter is not defined, it will be fallback to `false` and the SDK will use the sandbox environment.

▫️ The minimal configuration for setting up RolleeConnect component:

```javascript
const CONFIG = {
  sessionToken: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
};
```

▫️ The optional configuration for setting up RolleeConnect component:

```javascript
const CONFIG = {
  sessionToken: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
  production: false,
  customizationId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
};

```

## Setup paramteres description

| Param              | Description                                                                                                |
| ------------------ | ---------------------------------------------------------------------------------------------------------- |
| sessionToken       | `String` - defining user session on Rollee Connect application                                             |
| production         | `Boolean` - parameter for switching between sandbox and production env                                     |
| customizationId    | `String` - parameter for adding customization defined in Rollee Dashboard                                  |

---
_Source: https://npm.io/package/@getrollee/connect-react-native-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
