1.2.1 • Published 1 year ago
@getrollee/connect-react-sdk v1.2.1
Installation
$ npm i @getrollee/connect-react-sdk
Change Log
v.1.2.1
- small fixes
v1.2.0
==Breaking changes - Important!==
- adding
customizationId
parameter to configuration - removing
setup
parameter from configuration - removing
token
parameter from configuration
v1.1.2
- onCompleted callback fix
v1.1.1
- small fixes
v1.1.0
- onLoginSuccess callback added
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.
import RolleeConnect from '@getrollee/connect-react-sdk';
.
.
.
<RolleeConnect config={CONFIG} onCompleted={onCompleted} />;
Configuration
To define a User Session on Rollee Connect, you must provide the mandatory parameters token
and sessionToken
.
The setup
parameters are optional.
▫️ The minimal configuration for setting up RolleeConnect component:
const CONFIG = {
sessionToken: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
};
The optional configuration for setting up RolleeConnect component:
const CONFIG = {
sessionToken: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
production: false,
customizationId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
};
// If you wish not to customize one of the parameters present in `setup`, you can just delete them and the SDK will use the respective default value.
Testing SDK in the Sandbox
To be able to test SDK in Sandbox mode, you should provide a setup parameter named production and set it to false.
setup: {
production: false
}
Setup Parameters Descriptions
Param | Description |
---|---|
sessionToken | String - defining user session on Rollee Connect application |
production | Boolean - parameter for switching between sandbox and production env |
customizationId | String - defining customization on Rollee Connect application |
For more information about the setuping up your SDK, please visit our documentation.