Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit fed0b43

Browse files
committed
update Readme
1 parent 85574d1 commit fed0b43

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

README.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,47 +129,58 @@ import { useCryptr } from `@cryptr/cryptr-react-native`
129129

130130
// ...
131131

132-
const { /**/ } = useCryptr()
132+
const { /* Any required hook */ } = useCryptr()
133133
```
134134

135135
#### isAuthenticated
136136

137137
Hook to know if a Cryptr session is active
138138

139-
The return type is a boolean
139+
The return type is a <u>**boolean**</u>
140140

141141
```js
142142
const { isAuthenticated } = useCryptr()
143+
144+
if(isAuthenticated) { /**/ }
143145
```
144146

145147
#### user
146148

147149
Hook to retrieve the User information (extracted from current oAuth Cryptr active session ID Token)
148150

149-
The return type is a key/value pair Object.
151+
The return type is a <u>**key/value pair Object.**</u>
150152

151153
```js
152154
const { user } = useCryptr()
155+
156+
// ...
157+
user()
153158
```
154159

155160
#### accessToken
156161

157162
Hook to retrieve the current accessToken value
158163

159-
The return type is a string.
164+
The return type is a <u>** nullable string**</u>.
160165

161166
```js
162167
const { accessToken } = useCryptr()
168+
169+
//..
170+
{accessToken && <Text>{accessToken}</Text>}
163171
```
164172

165173
#### idToken
166174

167175
Hook to retrieve the current idToken value
168176

169-
The return type is a string.
177+
The return type is a <u>**string**</u>.
170178

171179
```js
172180
const { idToken } = useCryptr()
181+
182+
//...
183+
{idToken && <Text>{idToken}</Text>}
173184
```
174185

175186
--
@@ -182,9 +193,11 @@ Hook action to sign in the user using a specific SSO.
182193
*Requires* `idpId` value.
183194

184195

185-
186196
```js
187197
const { signinWithSSO } = useCryptr()
198+
199+
// [...]
200+
signinWithSSO(idpID: string, successCallback?: (data: any) => any, errorCallback?: (data: any) => any)
188201
```
189202

190203
#### refreshTokens
@@ -193,6 +206,9 @@ Hook action to refresh tokens to new ones.
193206

194207
```js
195208
const { refreshTokens } = useCryptr()
209+
210+
// [...]
211+
refreshTokens(callback?: (data: any) => any)
196212
```
197213

198214
#### logOut
@@ -202,6 +218,10 @@ Hook action to log out user.
202218

203219
```js
204220
const { logOut } = useCryptr()
221+
222+
// [...]
223+
224+
logOut(successCallback?: (data: any) => any, errorCallback?: (data: any) => any)
205225
```
206226

207227
--
@@ -220,7 +240,7 @@ const { error } = useCryptr()
220240

221241
Hook to inform you about that a Cryptr process is in progress.
222242

223-
The return type is a boolean
243+
The return type is a <u>**boolean**</u>
224244

225245
```js
226246
const { isLoading } = useCryptr()

0 commit comments

Comments
 (0)