Skip to content

Commit e05fd67

Browse files
committed
docs: version table update
1 parent 068775a commit e05fd67

File tree

5 files changed

+1502
-869
lines changed

5 files changed

+1502
-869
lines changed

docs/install.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,6 @@ The latest version of the Universal Sign In package supports:
122122
| | supported range |
123123
| ------------ | --------------- |
124124
| expo | 52.0.40 - 54 |
125-
| react-native | 0.76.0 - 0.81 |
125+
| react-native | 0.76.0 - 0.82 |
126126

127127
Use older versions of the package if you run older React Native / Expo.

docs/security.mdx

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ There are 2 security-related features available:
1717

1818
## Custom nonce
1919

20+
_Currently available only in version 21.x of the package_.
21+
2022
[Nonce](https://en.wikipedia.org/wiki/Cryptographic_nonce) (number used once) is a security measure used to mitigate replay attacks and to associate a Client session with an ID Token.
2123

22-
The authorization APIs in [Universal Sign-In](/docs/one-tap) for Apple, Android and web allow you to specify a nonce.
24+
The authorization APIs in [Universal Sign-In](/docs/one-tap) for Apple, Android and web allow you to specify nonce.
2325

2426
Example usage:
2527

@@ -36,8 +38,8 @@ import TabItem from '@theme/TabItem';
3638

3739
[//]: # 'or use uuid v4 with react-native-get-random-values or expo-crypto'
3840

39-
<Tabs>
40-
<TabItem value="expo-crypto" label="expo-crypto">
41+
<Tabs queryString="expo-or-community">
42+
<TabItem value="expo" label="expo-crypto">
4143

4244
```ts
4345
import * as Crypto from 'expo-crypto';
@@ -57,7 +59,7 @@ export function getUrlSafeNonce(byteLength = 32) {
5759

5860
</TabItem>
5961

60-
<TabItem value="react-native-get-random-values" label="react-native-get-random-values">
62+
<TabItem value="community" label="react-native-get-random-values">
6163

6264
```ts
6365
import 'react-native-get-random-values';
@@ -82,6 +84,9 @@ export function getUrlSafeNonce(byteLength = 32) {
8284

8385
Auth providers such as [Supabase](https://supabase.com/docs/reference/javascript/auth-signinwithidtoken) require passing SHA-256 hash (digest) of the nonce ([source](https://github.com/supabase/auth-js/blob/dfb40d24188f7e8b0d34e51ded15582086250c51/src/lib/types.ts#L612)). This can be done as follows:
8486

87+
<Tabs queryString="expo-or-community">
88+
<TabItem value="expo" label="expo-crypto">
89+
8590
```ts
8691
import { digestStringAsync, CryptoDigestAlgorithm } from 'expo-crypto';
8792

@@ -99,6 +104,29 @@ export const getNonce = async () => {
99104
};
100105
```
101106

107+
</TabItem>
108+
109+
<TabItem value="community" label="react-native-quick-crypto">
110+
111+
```ts
112+
import QuickCrypto from 'react-native-quick-crypto';
113+
114+
const getNonce = () => {
115+
// `rawNonce` goes to Supabase's signInWithIdToken().
116+
// Supabase makes a hash of `rawNonce` and compares it with the `nonceDigest`
117+
// which is included in the ID token from RN-google-signin.
118+
const rawNonce = getUrlSafeNonce();
119+
// `nonceDigest` (SHA-256 hash, hex-encoded) goes to the `nonce` parameter in RN-google-signin APIs
120+
const nonceDigest = QuickCrypto.createHash('sha256')
121+
.update(rawNonce)
122+
.digest('hex');
123+
return { rawNonce, nonceDigest };
124+
};
125+
```
126+
127+
</TabItem>
128+
</Tabs>
129+
102130
## App Check for iOS (advanced) {#appcheck}
103131

104132
App Check helps protect your apps from abuse by preventing unauthorized clients from authenticating using Google Sign-in: only the apps you've authorized can acquire access tokens and ID tokens from Google's OAuth 2.0 and OpenID Connect endpoint.

docusaurus.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ const config: Config = {
2626

2727
onBrokenLinks: 'throw',
2828
onBrokenAnchors: 'throw',
29-
onBrokenMarkdownLinks: 'throw',
29+
markdown: {
30+
hooks: {
31+
onBrokenMarkdownLinks: 'throw',
32+
},
33+
},
3034

3135
// Even if you don't use internationalization, you can use this field to set
3236
// useful metadata like html lang. For example, if your site is Chinese, you

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@
1717
"prettier:check": "prettier --list-different 'docs/**/*.{md,mdx}'"
1818
},
1919
"dependencies": {
20-
"@docusaurus/core": "^3.8.1",
21-
"@docusaurus/plugin-ideal-image": "^3.8.1",
22-
"@docusaurus/preset-classic": "^3.8.1",
20+
"@docusaurus/core": "^3.9.1",
21+
"@docusaurus/plugin-ideal-image": "^3.9.1",
22+
"@docusaurus/preset-classic": "^3.9.1",
2323
"@mdx-js/react": "^3.1.1",
2424
"clsx": "^2.1.1",
2525
"docusaurus-lunr-search": "^3.6.1",
2626
"prism-react-renderer": "^2.4.1",
27-
"react": "^19.1.1",
28-
"react-dom": "^19.1.1"
27+
"react": "^19.2.0",
28+
"react-dom": "^19.2.0"
2929
},
3030
"devDependencies": {
31-
"@docusaurus/faster": "^3.8.1",
32-
"@docusaurus/module-type-aliases": "^3.8.1",
33-
"@docusaurus/tsconfig": "^3.8.1",
34-
"@docusaurus/types": "^3.8.1",
35-
"@types/react": "^19.1.12",
31+
"@docusaurus/faster": "^3.9.1",
32+
"@docusaurus/module-type-aliases": "^3.9.1",
33+
"@docusaurus/tsconfig": "^3.9.1",
34+
"@docusaurus/types": "^3.9.1",
35+
"@types/react": "^19.2.2",
3636
"docusaurus-plugin-typedoc": "^1.4.2",
3737
"prettier": "^3.6.2",
38-
"typedoc": "^0.28.11",
39-
"typedoc-plugin-markdown": "^4.8.1",
38+
"typedoc": "^0.28.14",
39+
"typedoc-plugin-markdown": "^4.9.0",
4040
"typescript": "~5.9.2"
4141
},
4242
"browserslist": {

0 commit comments

Comments
 (0)