Skip to content

Latest commit

 

History

History
98 lines (70 loc) · 3.86 KB

README.md

File metadata and controls

98 lines (70 loc) · 3.86 KB

npm package react-native-phyllo-connect is released under the MIT license.

Configuring the SDK

In your React Native project directory:

npm install react-native-phyllo-connect

Then install iOS dependencies using cocoapods:
Version

cd ios && pod install

React Native implementation

Importing from react-native-phyllo-connect

import PhylloConnect from 'react-native-phyllo-connect'

Subscribing to events

// Subscribe to an event by passing a callback
PhylloConnect.on('<event-type>', callbackFunction)

const callbackFunction = (body) => {
  // callback body
}

Event types can be exit, accountConnected, accountDisconnected, or tokenExpired.

Event type Description Callback body
exit Called when a user exits from phyllo flow user_id, reason
accountConnected Called when a user connects a platform user_id, account_id, work_platform_id
accountDisconnected Called when a user disconnects a platform user_id, account_id, work_platform_id
tokenExpired Called when a user token expires user_id

Creating a user and token

Open Phyllo SDK flow

import { PhylloEnvironment } from 'react-native-phyllo-connect'

const config = {
  clientDisplayName: clientDisplayName,
  token: token,
  userId: userId,
  environment: PhylloEnvironment.<environmentType>,
  workPlatformId: workPlatformId,
}

const phylloConnect = PhylloConnect.initialize(config)
phylloConnect.open()
Arguments Value Type
clientDisplayName Client Display Name String
token User Token String
userId User Id String
environment Environment PhylloEnvironment.sandbox or PhylloEnvironment.development or PhylloEnvironment.production
workPlatformId Platform Id (optional) String or Null

Examples

Try our sample app

Facing any issue? We have listed solutions for some comman issues here, If it doesn't help you, feel free to raise an issue in the issues section or report your issue on #bug-reports channel of our Discord server.

Author

Phyllo, [email protected]

License

PhylloConnect is available under the MIT license. See the LICENSE file for more information.