ada-rn-wrapper
React Native Wrapper for ada js lib
Installation
npm install @piebits/ada-rn-wrapper
required step as the library uses react-native-keychain to persist auth data
npm install react-native-keychain
Usage
import ada from "@piebits/ada-rn-wrapper";
ada.configure({
app_id: 'your piebits app_id',
version: 'v0.4.0',
expiration: 'access_token expiration'
})
ada.reaction(() => ada.store.status, (status) => {
console.log(`Status Changes, current status ${status}`);
})
ada.store.events.addListener('AuthState', (status) => {
console.log(`Status Changes, current status ${status}`);
});
ada.basic.signup({
email: 'johndoe@example.com',
password: 'johndoepassword'
})
ada.basic.signin({
key: 'johndoe@example.com',
password: 'johndoepassword'
})
const user = await ada.userops.fetchSelf()
const tokens = await ada.userops.refreshToken()
ada.userops.logout()
ada.userops.resetPass('email here')
ada.userops.verifyToken('token recieved from url', 'user entered password')
ada.store
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
Apache-2.0