In your React Native project directory:
npm install react-native-phyllo-connect
Then install iOS dependencies using cocoapods:
cd ios && pod install
import PhylloConnect from 'react-native-phyllo-connect'
// 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 |
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 |
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.
Phyllo, [email protected]
PhylloConnect is available under the MIT license. See the LICENSE file for more information.