Skip to content

Commit facb6c6

Browse files
committed
update read me
1 parent 31b130b commit facb6c6

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const AUTH0_OPTIONS = {
3030
domain: AUTH_CLIENT_DOMAIN,
3131
}
3232

33-
// You can handle the credentials obtained in auth0 and store them in the async store or another store of your choice
33+
// You can handle the credentials obtained in auth0
34+
// and store them in the async store or another store of your choice
3435
const CREDENTIALS_HANDLER = {
3536
save: async (credentials): Promise<void> => {
3637
const value = JSON.stringify(credentials);
@@ -49,3 +50,20 @@ const CREDENTIALS_HANDLER = {
4950
export const client = new Auth0Native(AUTH0_OPTIONS, CREDENTIALS_HANDLER);
5051
```
5152

53+
Then import the client and pass through props to the provider:
54+
55+
```tsx
56+
import { AuthProvider } from '@cobuildlab/react-native-auth0';
57+
import { client } from './config';
58+
59+
60+
const AUTH0_SCOPE = 'offline_access email openid profile';
61+
62+
export const App = () => (
63+
<AuthProvider
64+
client={auth0NativeClient}
65+
scope={AUTH0_SCOPE}>
66+
<App />
67+
</AuthProvider>
68+
);
69+
```

0 commit comments

Comments
 (0)