File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ id : react-native
3
+ title : react-native
4
+ sidebar_label : react-native
5
+ ---
6
+
7
+ By default accounts-js use the ` localStorage ` api to store the tokens.
8
+
9
+ Since react-native does not have ` localStorage ` , we can use the [ React Native Async Storage] ( https://github.com/react-native-community/async-storage ) .
10
+
11
+ To setup the client to use the AsyncStorage api you need to apply the following configuration:
12
+
13
+ ``` javascript
14
+ import AsyncStorage from ' @react-native-community/async-storage' ;
15
+ import { AccountsClient } from ' @accounts/client' ;
16
+
17
+ const accounts = new AccountsClient ({
18
+ // We tell the accounts-js client to use AsyncStorage to store the tokens
19
+ tokenStorage: AsyncStorage,
20
+ });
21
+ ```
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ module.exports = {
17
17
'strategies/oauth' ,
18
18
'strategies/twitter' ,
19
19
] ,
20
+ Cookbook : [ 'cookbook/react-native' ] ,
20
21
} ,
21
22
api : {
22
23
'Api Docs' : [
You can’t perform that action at this time.
0 commit comments