Bvndle Authentication Client
Authenticate with Bvndle for React Native. See Onboard Partners to use Bvndle Partner services.
Quick start
Install
npm install @bvndle/auth-react-native
yarn add @bvndle/auth-react-native
Usage
import { initAuthClient } from "@bvndle/auth-react-native";
const AUTH_CLIENT = initAuthClient({
env: "<ENV>",
clientId: "<YOUR_CLIENT_ID>",
scope: "<SCOPE>",
redirectUrl: "<REDIRECT_URL>",
});
const App = () => {
const handleSignIn = () => {
AUTH_CLIENT.signIn({
onSuccess: (token) => {
},
onError: (err) => {
},
});
};
return <Pressable onPress={handleSignIn}>Sign in with Bvndle</Pressable>;
};
Merge user account with Bvndle
const handleMergeAccount = () => {
AUTH_CLIENT.mergeAccount({
userId: "<USER_ID>",
redirectUrl: "<REDIRECT_URL>",
});
};
<Pressable onPress={handleMergeAccount}>Merge Account</Pressable>;
Initializing Bvndle SSO Client initAuthClient
:
env | dev | prod | Environment you want to use. |
clientId | string | Client ID created after partner registration. |
redirectUrl | string | App scheme or universal link. The redirect URL after sign in. |
scope | email | fullname | profile | (optional) Determines the user data that is returned. Default is profile . |
Merging user account with Bvndle mergeAccount
:
userId | string | The registered user ID with the partner application. |
redirectUrl | string | (optional) The redirect URL after merge account. |