Skip to content

Commit 7bbec1d

Browse files
docs: sign-in with Internet Identity on id.ai (#519)
* docs: sign-in with Internet Identity on id.ai Signed-off-by: David Dal Busco <david.dalbusco@outlook.com> * 📄 Update LLMs.txt snapshot for PR review --------- Signed-off-by: David Dal Busco <david.dalbusco@outlook.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent f01a3e9 commit 7bbec1d

2 files changed

Lines changed: 28 additions & 10 deletions

File tree

.llms-snapshots/llms-full.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,12 +902,12 @@ Internet Identity sign-in can be customized with options that let you control se
902902
| `windowed` | `boolean` | `true` | By default, the authentication flow is presented in a popup window on desktop that is automatically centered on the browser. This behavior can be turned off by setting the option to `false`, causing the authentication flow to happen in a separate tab instead. |
903903
| `derivationOrigin` | `string` or `URL` | | The main domain to be used to ensure your users are identified with the same public ID, regardless of which of your satellite's URLs they use to access your application. |
904904
| `onProgress` | `(progress) => void` | | Callback for provider sign-in and user creation/loading. |
905-
| `domain` | `internetcomputer.org` or `ic0.app` | `internetcomputer.org` | The domain on which to open Internet Identity. |
905+
| `domain` | `internetcomputer.org` or `ic0.app` or `id.ai` | `internetcomputer.org` | The domain on which to open Internet Identity. |
906906

907907
Example with options:
908908

909909
```
910-
await signIn({ ii: { options: { maxTimeToLiveInNanoseconds: BigInt(24 * 60 * 60 * 1000 * 1000 * 1000), // 1 day onProgress: ({ step, state }) => { console.log("Step:", step, "State:", state); }, derivationOrigin: "https://myapp.com" } }});
910+
// Sign-in with id.aiawait signIn({ ii: { options: { domain: "id.ai" } }});// Sign-in with a specific session durationawait signIn({ ii: { options: { maxTimeToLiveInNanoseconds: BigInt(24 * 60 * 60 * 1000 * 1000 * 1000) // 1 day } }});// Sign-in with a derivation origin and progression callbackawait signIn({ ii: { options: { onProgress: ({ step, state }) => { console.log("Step:", step, "State:", state); }, derivationOrigin: "https://myapp.com" } }});
911911
```
912912

913913
#### Handling Errors

docs/build/authentication/development.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,21 +166,39 @@ await signIn({
166166

167167
Internet Identity sign-in can be customized with options that let you control session lifetime, provider configuration, or track progress during the flow.
168168

169-
| Option | Type | Default | Description |
170-
| ---------------------------- | ------------------------------------------ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
171-
| `maxTimeToLiveInNanoseconds` | `BigInt(4 * 60 * 60 * 1000 * 1000 * 1000)` | **4 hours** | Maximum lifetime of the user's session in **nanoseconds**. Once expired, the session cannot be extended. |
172-
| `windowed` | `boolean` | `true` | By default, the authentication flow is presented in a popup window on desktop that is automatically centered on the browser. This behavior can be turned off by setting the option to `false`, causing the authentication flow to happen in a separate tab instead. |
173-
| `derivationOrigin` | `string` or `URL` | | The main domain to be used to ensure your users are identified with the same public ID, regardless of which of your satellite's URLs they use to access your application. |
174-
| `onProgress` | `(progress) => void` | | Callback for provider sign-in and user creation/loading. |
175-
| `domain` | `internetcomputer.org` or `ic0.app` | `internetcomputer.org` | The domain on which to open Internet Identity. |
169+
| Option | Type | Default | Description |
170+
| ---------------------------- | ---------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
171+
| `maxTimeToLiveInNanoseconds` | `BigInt(4 * 60 * 60 * 1000 * 1000 * 1000)` | **4 hours** | Maximum lifetime of the user's session in **nanoseconds**. Once expired, the session cannot be extended. |
172+
| `windowed` | `boolean` | `true` | By default, the authentication flow is presented in a popup window on desktop that is automatically centered on the browser. This behavior can be turned off by setting the option to `false`, causing the authentication flow to happen in a separate tab instead. |
173+
| `derivationOrigin` | `string` or `URL` | | The main domain to be used to ensure your users are identified with the same public ID, regardless of which of your satellite's URLs they use to access your application. |
174+
| `onProgress` | `(progress) => void` | | Callback for provider sign-in and user creation/loading. |
175+
| `domain` | `internetcomputer.org` or `ic0.app` or `id.ai` | `internetcomputer.org` | The domain on which to open Internet Identity. |
176176

177177
Example with options:
178178

179179
```typescript
180+
// Sign-in with id.ai
181+
await signIn({
182+
ii: {
183+
options: {
184+
domain: "id.ai"
185+
}
186+
}
187+
});
188+
189+
// Sign-in with a specific session duration
190+
await signIn({
191+
ii: {
192+
options: {
193+
maxTimeToLiveInNanoseconds: BigInt(24 * 60 * 60 * 1000 * 1000 * 1000) // 1 day
194+
}
195+
}
196+
});
197+
198+
// Sign-in with a derivation origin and progression callback
180199
await signIn({
181200
ii: {
182201
options: {
183-
maxTimeToLiveInNanoseconds: BigInt(24 * 60 * 60 * 1000 * 1000 * 1000), // 1 day
184202
onProgress: ({ step, state }) => {
185203
console.log("Step:", step, "State:", state);
186204
},

0 commit comments

Comments
 (0)