@tempoxyz/id 0.0.0-pr-479.sha-3ea98d2 → 0.0.0-pr-481.sha-e1aaa69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/README.md +0 -2
  2. package/dist/Actions.d.ts +13 -13
  3. package/dist/Actions.js +9 -9
  4. package/dist/Actions.js.map +1 -1
  5. package/dist/Authorization.d.ts +1 -1
  6. package/dist/Authorization.d.ts.map +1 -1
  7. package/dist/Id.d.ts +10 -10
  8. package/dist/Id.d.ts.map +1 -1
  9. package/dist/Id.js +3 -3
  10. package/dist/Id.js.map +1 -1
  11. package/dist/Key.d.ts +8 -8
  12. package/dist/Key.d.ts.map +1 -1
  13. package/dist/Key.js +5 -5
  14. package/dist/Key.js.map +1 -1
  15. package/dist/Pending.d.ts +2 -2
  16. package/dist/Pending.d.ts.map +1 -1
  17. package/dist/Permissions.d.ts +7 -7
  18. package/dist/Permissions.d.ts.map +1 -1
  19. package/dist/Plugin.d.ts +1 -1
  20. package/dist/Plugin.d.ts.map +1 -1
  21. package/dist/Session.d.ts +1 -1
  22. package/dist/Session.js +1 -1
  23. package/dist/actions/account.d.ts +14 -14
  24. package/dist/actions/account.d.ts.map +1 -1
  25. package/dist/actions/account.js +6 -6
  26. package/dist/actions/account.js.map +1 -1
  27. package/dist/actions/backend/email.d.ts +4 -4
  28. package/dist/actions/backend/email.js +4 -4
  29. package/dist/actions/backend/email.js.map +1 -1
  30. package/dist/actions/device.d.ts +3 -3
  31. package/dist/actions/device.js +2 -2
  32. package/dist/actions/device.js.map +1 -1
  33. package/dist/actions/dialog.d.ts +5 -5
  34. package/dist/actions/dialog.d.ts.map +1 -1
  35. package/dist/actions/dialog.js +3 -3
  36. package/dist/actions/email.d.ts +12 -12
  37. package/dist/actions/email.d.ts.map +1 -1
  38. package/dist/actions/email.js +10 -10
  39. package/dist/actions/email.js.map +1 -1
  40. package/dist/actions/passkey.d.ts +18 -18
  41. package/dist/actions/passkey.d.ts.map +1 -1
  42. package/dist/actions/passkey.js +13 -13
  43. package/dist/actions/passkey.js.map +1 -1
  44. package/dist/actions/redirect.d.ts +10 -10
  45. package/dist/actions/redirect.d.ts.map +1 -1
  46. package/dist/actions/redirect.js +5 -5
  47. package/dist/actions/redirect.js.map +1 -1
  48. package/dist/internal/accessKey.d.ts +6 -6
  49. package/dist/internal/accessKey.d.ts.map +1 -1
  50. package/dist/internal/accessKey.js +4 -4
  51. package/dist/internal/api.d.ts +7 -7
  52. package/dist/internal/api.d.ts.map +1 -1
  53. package/dist/internal/api.js +5 -5
  54. package/dist/internal/api.js.map +1 -1
  55. package/dist/internal/backendSessions.d.ts +1 -1
  56. package/dist/internal/backendSessions.js +2 -2
  57. package/dist/internal/backendSessions.js.map +1 -1
  58. package/dist/internal/core.d.ts +4 -4
  59. package/dist/internal/core.d.ts.map +1 -1
  60. package/dist/internal/core.js +5 -5
  61. package/dist/internal/core.js.map +1 -1
  62. package/dist/internal/headless.d.ts +15 -15
  63. package/dist/internal/headless.d.ts.map +1 -1
  64. package/dist/internal/headless.js +7 -7
  65. package/dist/internal/headless.js.map +1 -1
  66. package/dist/internal/request.d.ts +8 -8
  67. package/dist/internal/request.d.ts.map +1 -1
  68. package/dist/internal/request.js +4 -4
  69. package/dist/internal/request.js.map +1 -1
  70. package/dist/internal/session.d.ts +1 -1
  71. package/dist/internal/session.js +2 -2
  72. package/dist/internal/session.js.map +1 -1
  73. package/dist/internal/signIn.d.ts +4 -4
  74. package/dist/internal/signIn.d.ts.map +1 -1
  75. package/dist/internal/signIn.js +2 -2
  76. package/dist/internal/signIn.js.map +1 -1
  77. package/dist/internal/signer.d.ts +1 -1
  78. package/dist/internal/signer.js +2 -2
  79. package/dist/internal/signer.js.map +1 -1
  80. package/dist/internal/verifier.d.ts +2 -2
  81. package/dist/internal/verifier.d.ts.map +1 -1
  82. package/dist/internal/viem/accessKey.d.ts +5 -5
  83. package/dist/internal/viem/accessKey.d.ts.map +1 -1
  84. package/dist/internal/viem/accessKey.js +7 -7
  85. package/dist/internal/viem/accessKey.js.map +1 -1
  86. package/dist/plugins/backend.d.ts +1 -1
  87. package/dist/plugins/device.d.ts +3 -3
  88. package/dist/plugins/device.js +1 -1
  89. package/dist/plugins/dialog.d.ts +1 -1
  90. package/dist/plugins/email.d.ts +4 -4
  91. package/dist/plugins/email.js +1 -1
  92. package/dist/plugins/passkey.d.ts +3 -3
  93. package/dist/plugins/passkey.js +1 -1
  94. package/dist/plugins/passkey.js.map +1 -1
  95. package/dist/plugins/redirect.d.ts +1 -1
  96. package/dist/plugins/viem.d.ts +1 -1
  97. package/dist/plugins/viem.js +1 -1
  98. package/dist/plugins/viem.js.map +1 -1
  99. package/dist/wagmi.d.ts +3 -3
  100. package/dist/wagmi.js +6 -6
  101. package/dist/wagmi.js.map +1 -1
  102. package/package.json +2 -2
  103. package/src/Actions.ts +16 -16
  104. package/src/Authorization.ts +1 -1
  105. package/src/Id.ts +10 -10
  106. package/src/Key.ts +9 -9
  107. package/src/Pending.ts +2 -2
  108. package/src/Permissions.ts +7 -7
  109. package/src/Plugin.ts +1 -1
  110. package/src/Session.ts +1 -1
  111. package/src/actions/account.ts +15 -15
  112. package/src/actions/backend/email.ts +6 -6
  113. package/src/actions/device.ts +4 -4
  114. package/src/actions/dialog.ts +5 -5
  115. package/src/actions/email.ts +16 -16
  116. package/src/actions/passkey.ts +24 -24
  117. package/src/actions/redirect.ts +14 -14
  118. package/src/internal/accessKey.ts +6 -6
  119. package/src/internal/api.ts +9 -9
  120. package/src/internal/backendSessions.ts +4 -4
  121. package/src/internal/core.ts +7 -7
  122. package/src/internal/headless.ts +18 -18
  123. package/src/internal/request.ts +11 -11
  124. package/src/internal/session.ts +3 -3
  125. package/src/internal/signIn.ts +4 -4
  126. package/src/internal/signer.ts +2 -2
  127. package/src/internal/verifier.ts +2 -2
  128. package/src/internal/viem/accessKey.ts +8 -8
  129. package/src/plugins/backend.ts +1 -1
  130. package/src/plugins/device.ts +3 -3
  131. package/src/plugins/dialog.ts +1 -1
  132. package/src/plugins/email.ts +4 -4
  133. package/src/plugins/passkey.ts +4 -4
  134. package/src/plugins/redirect.ts +1 -1
  135. package/src/plugins/viem.ts +2 -2
  136. package/src/wagmi.ts +7 -7
@@ -17,7 +17,7 @@ import type { Permissions } from '../Permissions.js'
17
17
  * resolves with the authorization. The instance's `clientId` names the device app, such as
18
18
  * `tempo-cli`, whose realms the sign-in uses. A CLI without a registration sends `cli:` and its
19
19
  * name, such as `cli:acme-deploy`. The device page then shows its name as unverified, and its
20
- * `permissions` must name the key's `expiry`, `limits`, and `scopes`.
20
+ * `permissions` must name the access key's `expiry`, `limits`, and `scopes`.
21
21
  *
22
22
  * @example
23
23
  * ```ts
@@ -38,7 +38,7 @@ export async function authorize<const chainId extends number = number>(
38
38
  options: authorize.Options<chainId>,
39
39
  ): Promise<authorize.ReturnType<chainId>> {
40
40
  const key = await AccessKey.resolve(options.accessKey)
41
- // The device authorization request (RFC 8628 §3.1), with the key as base64url JSON.
41
+ // The device authorization request (RFC 8628 §3.1), with the access key as base64url JSON.
42
42
  const code = await Api.json<{
43
43
  device_code: string
44
44
  expires_in: number
@@ -128,7 +128,7 @@ export async function authorize<const chainId extends number = number>(
128
128
  export declare namespace authorize {
129
129
  type Options<chainId extends number = number> = {
130
130
  /**
131
- * The key to authorize. Defaults to a new key. Its `access` names the Tempo Account, which
131
+ * The access key to authorize. Defaults to a new access key. Its `access` names the Tempo Account, which
132
132
  * defaults to the one the user selects at sign-in, or the user's oldest.
133
133
  */
134
134
  accessKey?: Account.Account | undefined
@@ -148,7 +148,7 @@ export declare namespace authorize {
148
148
  */
149
149
  funding?: Funding.Funding | undefined
150
150
  /**
151
- * What the key may do. The grant always authorizes a key, so the app names its permissions, and
151
+ * What the access key may do. The grant always authorizes an access key, so the app names its permissions, and
152
152
  * the user approves them, so they may exceed the headless ceiling.
153
153
  */
154
154
  permissions: Permissions<chainId>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Signs the user in on Tempo ID without leaving the app's page: in a frame of Tempo ID's embedded
3
3
  * sign-in, which a dialog shows on the page, or in a popup window. Either way the page keeps the
4
- * PKCE verifier and the key in memory, and redeems the code. Tempo ID's page in a popup posts the
4
+ * PKCE verifier and the access key in memory, and redeems the code. Tempo ID's page in a popup posts the
5
5
  * callback to the page that opened it. On a page whose own `Cross-Origin-Opener-Policy` severs that
6
6
  * handle, the popup returns to the redirect URI, whose page calls {@link callback}.
7
7
  * @module
@@ -98,7 +98,7 @@ export async function callback(auth: Config): Promise<boolean> {
98
98
  * creates the client, unless its `preload` is `false`. Without it, the dialog shows once its frame
99
99
  * loads.
100
100
  *
101
- * The frame loads without a request, so `signIn` takes it whatever its key, permissions, or
101
+ * The frame loads without a request, so `signIn` takes it whatever its access key, permissions, or
102
102
  * challenge. Each sign-in keeps the frame loaded, and the next one posts its request to the same
103
103
  * frame, which starts the sign-in again. Outside a secure context, and for an instance that pushes
104
104
  * its requests with `par`, it loads nothing, since `signIn` then opens a popup. On a page that is
@@ -145,12 +145,12 @@ export declare namespace preload {
145
145
  * - `iframe`, the default, shows Tempo ID's embedded sign-in in a dialog on the page: a compact
146
146
  * modal, or a bottom sheet on a narrow screen. The dialog shows once its frame shows the request,
147
147
  * at once after {@link preload}. The frame shows the approval page and the account step itself. A
148
- * first-party app's key must fit the headless ceiling. When the frame cannot load, or the sign-in
148
+ * first-party app's access key must fit the headless ceiling. When the frame cannot load, or the sign-in
149
149
  * needs a wallet upgrade, the dialog offers a popup, which the user's click opens. In a browser without
150
150
  * IntersectionObserver v2, the call signs in with `popup` instead, unless the preloaded frame
151
151
  * reported that Tempo ID trusts the app.
152
152
  * - `popup` opens Tempo ID's pages in a popup window, with `display=popup`, so they show compact
153
- * screens. A key may exceed the headless ceiling, since the approval page shows it.
153
+ * screens. An access key may exceed the headless ceiling, since the approval page shows it.
154
154
  *
155
155
  * The page must be on the origin of the redirect URI, since the callback reaches the page only on
156
156
  * that origin. Outside a secure context, `iframe` signs in with `popup`. An instance that pushes its
@@ -402,7 +402,7 @@ export declare namespace signIn {
402
402
  timeout?: number | undefined
403
403
  }
404
404
 
405
- /** The authorization, without its key for a sign-in without `permissions`. */
405
+ /** The authorization, without its access key for a sign-in without `permissions`. */
406
406
  type ReturnType<key extends boolean = false> = key extends false
407
407
  ? redirect.handleCallback.WithoutKey
408
408
  : Authorization
@@ -37,19 +37,19 @@ export declare namespace sendCode {
37
37
 
38
38
  /**
39
39
  * Signs the user in with an emailed code, and authorizes a first-party app in the same request. The
40
- * key must fit the headless ceiling. A sign-in with a key creates the user's first Tempo Account.
40
+ * access key must fit the headless ceiling. A sign-in with an access key creates the user's first Tempo Account.
41
41
  *
42
- * With `link`, the passkey of `Actions.passkey.signIn`'s email step signs again, and signs the key.
43
- * In a browser, a passkey that owns the account signs the key on the page after the code.
42
+ * With `link`, the passkey of `Actions.passkey.signIn`'s email step signs again, and signs the access key.
43
+ * In a browser, a passkey that owns the account signs the access key on the page after the code.
44
44
  *
45
45
  * A refusal after the code verified has `signedIn: true`. Outside a browser, and without `getFn`,
46
46
  * an account that a passkey owns throws `webauthn_required`. Another passkey's account, whose
47
47
  * relying party does not cover the page, throws it too. Then authorize through
48
48
  * `Actions.redirect.start`.
49
49
  *
50
- * A wallet.tempo passkey's account that waits for its upgrade signs the key as the passkey's own
51
- * account, and `upgradeAvailable` is `true`. `Actions.account.upgrade` with the key then upgrades
52
- * the account with one more prompt, after Tempo ID registers the key.
50
+ * A wallet.tempo passkey's account that waits for its upgrade signs the access key as the passkey's own
51
+ * account, and `upgradeAvailable` is `true`. `Actions.account.upgrade` with the access key then upgrades
52
+ * the account with one more prompt, after Tempo ID registers the access key.
53
53
  *
54
54
  * @example
55
55
  * ```ts
@@ -63,13 +63,13 @@ export async function signIn<
63
63
  options: signIn.Options<permissions>,
64
64
  ): Promise<signIn.ReturnType<ChainId<permissions>, Keyed<permissions>>> {
65
65
  const { code, email, getFn, link } = options
66
- // A challenge rides in the key, so a sign-in without one refuses it before it signs in.
66
+ // A challenge rides in the access key, so a sign-in without one refuses it before it signs in.
67
67
  if (!options.permissions && options.challenge !== undefined)
68
68
  throw new ChallengeWithoutKeyError()
69
69
  // The authorization request rides with the sign-in, so one request signs in, creates the first
70
- // account, and signs the key. The link's passkey signs again, so a page left at the email step
70
+ // account, and signs the access key. The link's passkey signs again, so a page left at the email step
71
71
  // links nothing for the next person, who cannot sign with it. Its options carry the authorization
72
- // request, so the same assertion signs the key.
72
+ // request, so the same assertion signs the access key.
73
73
  const prepared = await Headless.prepare(auth, options)
74
74
  const assertion = await (async () => {
75
75
  if (!link) return undefined
@@ -112,7 +112,7 @@ export async function signIn<
112
112
  ? { assertion, link }
113
113
  : {
114
114
  authorize: prepared.authorize,
115
- // A passkey that owns the account signs the key on this page, in place of a redirect.
115
+ // A passkey that owns the account signs the access key on this page, in place of a redirect.
116
116
  ...(Headless.steps(prepared.authorize, { getFn })
117
117
  ? { passkey: true }
118
118
  : {}),
@@ -169,7 +169,7 @@ export declare namespace signIn {
169
169
  permissions extends Permissions | undefined = Permissions | undefined,
170
170
  > = {
171
171
  /**
172
- * The key to authorize. Defaults to a new key. Its `access` names the Tempo Account, which
172
+ * The access key to authorize. Defaults to a new access key. Its `access` names the Tempo Account, which
173
173
  * defaults to the app's selected account, or the user's oldest.
174
174
  */
175
175
  accessKey?: Account.Account | undefined
@@ -182,7 +182,7 @@ export declare namespace signIn {
182
182
  | undefined
183
183
  /**
184
184
  * A message whose EIP-191 hash the key authorization binds as its `witness`. Needs the
185
- * `tempo-id:sign` scope and a key.
185
+ * `tempo-id:sign` scope and an access key.
186
186
  */
187
187
  challenge?: ([permissions] extends [undefined] ? never : string) | undefined
188
188
  /** The 6-digit code that Tempo ID emailed. */
@@ -199,7 +199,7 @@ export declare namespace signIn {
199
199
  * The call first runs the passkey's ceremony.
200
200
  */
201
201
  link?: string | undefined
202
- /** What the key may do, which a request for a key must name. Within the headless ceiling, unless the app holds `tempo-id:sign`. */
202
+ /** What the access key may do, which a request for an access key must name. Within the headless ceiling, unless the app holds `tempo-id:sign`. */
203
203
  permissions?: permissions
204
204
  /**
205
205
  * Whether to return passkey registration options as `registration`, in the same request as the
@@ -208,7 +208,7 @@ export declare namespace signIn {
208
208
  registration?: boolean | undefined
209
209
  }
210
210
 
211
- /** The authorization, without its key for a sign-in without `permissions`, and whether its account can upgrade. */
211
+ /** The authorization, without its access key for a sign-in without `permissions`, and whether its account can upgrade. */
212
212
  type ReturnType<
213
213
  chainId extends number = number,
214
214
  key extends boolean = false,
@@ -228,8 +228,8 @@ export declare namespace signIn {
228
228
  */
229
229
  registration?: RegistrationOptions.Registration | undefined
230
230
  /**
231
- * Whether the key's account is a wallet.tempo passkey's that waits for its upgrade on the key's
232
- * chain. `Actions.account.upgrade` with the key upgrades it, and keeps the key.
231
+ * Whether the access key's account is a wallet.tempo passkey's that waits for its upgrade on the access key's
232
+ * chain. `Actions.account.upgrade` with the access key upgrades it, and keeps the access key.
233
233
  */
234
234
  upgradeAvailable: boolean
235
235
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Signs the user in with a passkey from the app's own sign-in form, and authorizes the app's key.
2
+ * Signs the user in with a passkey from the app's own sign-in form, and authorizes the app's access key.
3
3
  * The handle of {@link prepare} requests the sign-in's options before the user acts, so its sign-in
4
4
  * starts the ceremony without a request. {@link register} adds a passkey for the signed-in user
5
5
  * from the app's page.
@@ -59,7 +59,7 @@ const preparedLifetime = 4 * 60 * 1000
59
59
  /**
60
60
  * Prepares a passkey sign-in before the user acts, such as when the sign-in form shows, and
61
61
  * returns its handle. The handle checks {@link available}, and where it returns `true`, requests
62
- * the sign-in's options and the key that it authorizes, so the handle's `signIn` starts the
62
+ * the sign-in's options and the access key that it authorizes, so the handle's `signIn` starts the
63
63
  * ceremony without a request. Create a new handle when the request options change.
64
64
  *
65
65
  * The handle owns its options. A sign-in uses them once, and requests new ones after 4 minutes.
@@ -128,13 +128,13 @@ export declare namespace prepare {
128
128
  permissions extends Permissions | undefined = Permissions | undefined,
129
129
  > = {
130
130
  /**
131
- * The key to authorize. Defaults to a new key. Its `access` names the Tempo Account, which
131
+ * The access key to authorize. Defaults to a new access key. Its `access` names the Tempo Account, which
132
132
  * defaults to the app's selected account, or the user's oldest.
133
133
  */
134
134
  accessKey?: Account.Account | undefined
135
135
  /**
136
136
  * A message whose EIP-191 hash the key authorization binds as its `witness`. Needs the
137
- * `tempo-id:sign` scope and a key.
137
+ * `tempo-id:sign` scope and an access key.
138
138
  */
139
139
  challenge?: ([permissions] extends [undefined] ? never : string) | undefined
140
140
  /**
@@ -144,7 +144,7 @@ export declare namespace prepare {
144
144
  credentialId?: readonly string[] | string | undefined
145
145
  /** The browser's mediation, such as `conditional` for autofill. Defaults to its own. */
146
146
  mediation?: 'conditional' | 'optional' | 'required' | 'silent' | undefined
147
- /** What the key may do, which a request for a key must name. Within the headless ceiling, unless the app holds `tempo-id:sign`. */
147
+ /** What the access key may do, which a request for an access key must name. Within the headless ceiling, unless the app holds `tempo-id:sign`. */
148
148
  permissions?: permissions
149
149
  /**
150
150
  * Whether the browser offers every passkey of the relying party, for a sign-in that starts
@@ -181,9 +181,9 @@ export declare namespace prepare {
181
181
  * the authenticator creates the passkey, then the new passkey signs a proof challenge, so call it
182
182
  * from a click.
183
183
  *
184
- * With `key`, the key of a sign-in on a cloud wallet's configurable account, the passkey joins that
185
- * account as a second owner on the key's chain, through an update that the cloud wallet signs. The
186
- * key keeps working. On a chain whose accounts are not configurable, `key` sets nothing, and the
184
+ * With `key`, the access key of a sign-in on a cloud wallet's configurable account, the passkey joins that
185
+ * account as a second owner on the access key's chain, through an update that the cloud wallet signs. The
186
+ * access key keeps working. On a chain whose accounts are not configurable, `key` sets nothing, and the
187
187
  * passkey owns an account of its own. `account` and `chain` name the account and chain instead.
188
188
  *
189
189
  * Requires a sign-in within the last 10 minutes, or throws `reauthentication_required`. A user who
@@ -203,7 +203,7 @@ export async function register(
203
203
  options: register.Options = {},
204
204
  ): Promise<register.ReturnType> {
205
205
  const { createFn, getFn, key } = options
206
- // Tempo ID reads a chain ID in `chain` as it reads a name. It decides whether the key's chain
206
+ // Tempo ID reads a chain ID in `chain` as it reads a name. It decides whether the access key's chain
207
207
  // takes an owner, so the page reads no chain list.
208
208
  const chain = options.chain ?? options.chainId
209
209
  // A sign-in's registration options save the options request while their challenge lasts.
@@ -327,9 +327,9 @@ export declare namespace register {
327
327
  /** Runs the proof ceremony in place of `navigator.credentials.get`. */
328
328
  getFn?: Authentication.sign.Options['getFn'] | undefined
329
329
  /**
330
- * The key of a sign-in on the cloud wallet's account, such as `authorization.key`. Tempo ID
331
- * reads its chain: on a chain whose accounts are configurable, the key sets the default
332
- * `account` and `chain`. Registration does not use the key otherwise.
330
+ * The access key of a sign-in on the cloud wallet's account, such as `authorization.key`. Tempo ID
331
+ * reads its chain: on a chain whose accounts are configurable, the access key sets the default
332
+ * `account` and `chain`. Registration does not use the access key otherwise.
333
333
  */
334
334
  key?: Pick<Key.Key, 'account' | 'chainId'> | undefined
335
335
  /**
@@ -353,7 +353,7 @@ export declare namespace register {
353
353
 
354
354
  /**
355
355
  * Signs the user in with a passkey, and authorizes a first-party app with the same assertion. The
356
- * key must fit the headless ceiling. A user without a Tempo Account receives one.
356
+ * access key must fit the headless ceiling. A user without a Tempo Account receives one.
357
357
  *
358
358
  * Returns an email step for a wallet.tempo passkey whose account has no email. Pass its `link` to
359
359
  * `Actions.email.signIn`.
@@ -363,9 +363,9 @@ export declare namespace register {
363
363
  * has `signedIn: true`. An account that another passkey owns throws `webauthn_required`, so
364
364
  * authorize through `Actions.redirect.start`.
365
365
  *
366
- * A wallet.tempo passkey's account that waits for its upgrade signs the key as the passkey's own
367
- * account, and `upgradeAvailable` is `true`. `Actions.account.upgrade` with the key then upgrades
368
- * the account with one more prompt, after Tempo ID registers the key.
366
+ * A wallet.tempo passkey's account that waits for its upgrade signs the access key as the passkey's own
367
+ * account, and `upgradeAvailable` is `true`. `Actions.account.upgrade` with the access key then upgrades
368
+ * the account with one more prompt, after Tempo ID registers the access key.
369
369
  *
370
370
  * It requests the sign-in's options when called. {@link prepare} requests them before the user
371
371
  * acts instead.
@@ -410,7 +410,7 @@ export declare namespace signIn {
410
410
  type: 'email'
411
411
  }
412
412
 
413
- /** The authorization, without its key for a sign-in without `permissions`, and whether its account can upgrade, or the email step. */
413
+ /** The authorization, without its access key for a sign-in without `permissions`, and whether its account can upgrade, or the email step. */
414
414
  type ReturnType<
415
415
  chainId extends number = number,
416
416
  key extends boolean = false,
@@ -419,8 +419,8 @@ export declare namespace signIn {
419
419
  ? Omit<Authorization<chainId>, 'accessKey' | 'key'>
420
420
  : Authorization<chainId>) & {
421
421
  /**
422
- * Whether the key's account is a wallet.tempo passkey's that waits for its upgrade on the
423
- * key's chain. `Actions.account.upgrade` with the key upgrades it, and keeps the key.
422
+ * Whether the access key's account is a wallet.tempo passkey's that waits for its upgrade on the
423
+ * access key's chain. `Actions.account.upgrade` with the access key upgrades it, and keeps the access key.
424
424
  */
425
425
  upgradeAvailable: boolean
426
426
  })
@@ -470,13 +470,13 @@ function refused(error: unknown) {
470
470
  )
471
471
  }
472
472
 
473
- /** A passkey sign-in's options and the key that they authorize, which one sign-in uses. */
473
+ /** A passkey sign-in's options and the access key that they authorize, which one sign-in uses. */
474
474
  type Prepared = {
475
475
  /** The authorization request that the options carry, which the passkey step repeats. */
476
476
  authorize: Awaited<ReturnType<typeof Headless.prepare>>['authorize']
477
477
  /** When a sign-in stops using the options, in milliseconds since the epoch. */
478
478
  expiresAt: number
479
- /** The key that the options authorize. Absent without `permissions`. */
479
+ /** The access key that the options authorize. Absent without `permissions`. */
480
480
  key: AccessKey.resolve.ReturnType | undefined
481
481
  /** The options of the WebAuthn ceremony, with Tempo ID's challenge. */
482
482
  options: Types.CredentialRequestOptions
@@ -485,7 +485,7 @@ type Prepared = {
485
485
  }
486
486
 
487
487
  /**
488
- * Requests the options of a passkey sign-in, and the key that they authorize.
488
+ * Requests the options of a passkey sign-in, and the access key that they authorize.
489
489
  * @throws {ChallengeWithoutKeyError} For a challenge without `permissions`, before any request.
490
490
  */
491
491
  async function requestOptions(
@@ -493,10 +493,10 @@ async function requestOptions(
493
493
  options: prepare.Options,
494
494
  ): Promise<Prepared> {
495
495
  const { credentialId, mediation, select } = options
496
- // A challenge rides in the key, so a sign-in without one refuses it before it signs in.
496
+ // A challenge rides in the access key, so a sign-in without one refuses it before it signs in.
497
497
  if (!options.permissions && options.challenge !== undefined)
498
498
  throw new ChallengeWithoutKeyError()
499
- // The options carry the authorization request, so the challenge is its key's digest.
499
+ // The options carry the authorization request, so the challenge is its access key's digest.
500
500
  const { authorize, key } = await Headless.prepare(auth, options)
501
501
  // The challenge's lifetime starts at Tempo ID before the response arrives, so the options' does too.
502
502
  const requestedAt = Date.now()
@@ -22,7 +22,7 @@ import type { Keyed, Permissions } from '../Permissions.js'
22
22
  * it sends the code exchange at once, from the tab's copy of the verifier, before IndexedDB returns
23
23
  * the rest of the redirect's state. A callback that denies the
24
24
  * redirect, such as `error=access_denied`, throws a `RequestError` with that `code` and status 0.
25
- * The result carries a key when `start` received `permissions`.
25
+ * The result carries an access key when `start` received `permissions`.
26
26
  *
27
27
  * @example
28
28
  * ```ts
@@ -113,12 +113,12 @@ export function complete(
113
113
 
114
114
  export declare namespace complete {
115
115
  type Options = {
116
- /** The key that the app passed to {@link start}, if any. */
116
+ /** The access key that the app passed to {@link start}, if any. */
117
117
  accessKey?: Account.Account | undefined
118
118
  }
119
119
 
120
120
  /**
121
- * The authorization, with its key when `start` received `permissions`. `undefined` when the page
121
+ * The authorization, with its access key when `start` received `permissions`. `undefined` when the page
122
122
  * is not a redirect's callback.
123
123
  */
124
124
  type ReturnType = handleCallback.WithoutKey | Authorization | undefined
@@ -157,7 +157,7 @@ export declare namespace createUrl {
157
157
  permissions extends Permissions | undefined = Permissions | undefined,
158
158
  > = {
159
159
  /**
160
- * The key to authorize. Defaults to a new key, whose material `pending` keeps. Its `access`
160
+ * The access key to authorize. Defaults to a new access key, whose material `pending` keeps. Its `access`
161
161
  * names the Tempo Account, which defaults to the one the user selects, or the user's oldest.
162
162
  */
163
163
  accessKey?: Account.Account | undefined
@@ -220,7 +220,7 @@ export declare namespace handleCallback {
220
220
  type Options<
221
221
  pending extends Pending.Pending | Pending.WithoutKey = Pending.Pending,
222
222
  > = {
223
- /** The key that the app passed to `createUrl`, if any. */
223
+ /** The access key that the app passed to `createUrl`, if any. */
224
224
  accessKey?: Account.Account | undefined
225
225
  /** What `createUrl` returned to keep. */
226
226
  pending: pending
@@ -228,7 +228,7 @@ export declare namespace handleCallback {
228
228
  url: string | URL
229
229
  }
230
230
 
231
- /** The authorization, without its key for a `Pending.WithoutKey`. */
231
+ /** The authorization, without its access key for a `Pending.WithoutKey`. */
232
232
  type ReturnType<
233
233
  pending extends Pending.Pending | Pending.WithoutKey = Pending.Pending,
234
234
  > = [pending] extends [Pending.WithoutKey]
@@ -237,7 +237,7 @@ export declare namespace handleCallback {
237
237
  ? Authorization
238
238
  : Authorization | WithoutKey
239
239
 
240
- /** A sign-in without a key: the tokens and the user. */
240
+ /** A sign-in without an access key: the tokens and the user. */
241
241
  type WithoutKey = Omit<Authorization, 'accessKey' | 'key'>
242
242
  }
243
243
 
@@ -309,15 +309,15 @@ declare namespace redeem {
309
309
  }
310
310
 
311
311
  /**
312
- * Returns the authorization of a redeemed code, with the key of `pending`, or the tokens and the
313
- * user for a `Pending.WithoutKey`. Throws a `RequestError` when a redirect with a key receives no
312
+ * Returns the authorization of a redeemed code, with the access key of `pending`, or the tokens and the
313
+ * user for a `Pending.WithoutKey`. Throws a `RequestError` when a redirect with an access key receives no
314
314
  * key authorization.
315
315
  */
316
316
  function finish(
317
317
  options: finish.Options,
318
318
  ): Authorization | handleCallback.WithoutKey {
319
319
  const { body } = options
320
- // The exchange's fields stay out of the key's material.
320
+ // The exchange's fields stay out of the access key's material.
321
321
  const {
322
322
  key,
323
323
  chainId: _chainId,
@@ -352,7 +352,7 @@ function finish(
352
352
 
353
353
  declare namespace finish {
354
354
  type Options = {
355
- /** The key that the app passed to `createUrl`, if any. */
355
+ /** The access key that the app passed to `createUrl`, if any. */
356
356
  accessKey?: Account.Account | undefined
357
357
  /** The token response of the redeemed code. */
358
358
  body: Api.TokenResponse
@@ -408,7 +408,7 @@ export declare namespace prefetch {
408
408
  /**
409
409
  * Sends the browser to Tempo ID's pages to sign in, and keeps the redirect's state in `store`.
410
410
  * With the default store, it also keeps the `state`, the redirect URI, and the PKCE verifier in
411
- * the tab's `sessionStorage`, without the key's material. {@link complete} finishes it when the
411
+ * the tab's `sessionStorage`, without the access key's material. {@link complete} finishes it when the
412
412
  * browser returns.
413
413
  *
414
414
  * @example
@@ -428,11 +428,11 @@ export async function start(
428
428
 
429
429
  export declare namespace start {
430
430
  type Options = {
431
- /** The key to authorize, which {@link complete} needs too. Defaults to a new key. */
431
+ /** The access key to authorize, which {@link complete} needs too. Defaults to a new access key. */
432
432
  accessKey?: Account.Account | undefined
433
433
  /**
434
434
  * A message whose EIP-191 hash the key authorization binds as its `witness`. Needs the
435
- * `tempo-id:sign` scope and a key.
435
+ * `tempo-id:sign` scope and an access key.
436
436
  */
437
437
  challenge?: string | undefined
438
438
  /**
@@ -7,8 +7,8 @@ import { Account, Secp256k1 } from 'viem/tempo'
7
7
  import type * as Key from '../Key.js'
8
8
 
9
9
  /**
10
- * Returns the app's key, or creates one: a non-extractable `CryptoKey` in a browser, or else a
11
- * secp256k1 key.
10
+ * Returns the app's access key, or creates one: a non-extractable `CryptoKey` in a browser, or else a
11
+ * secp256k1 access key.
12
12
  */
13
13
  export async function resolve(
14
14
  accessKey: Account.Account | undefined,
@@ -31,8 +31,8 @@ export async function resolve(
31
31
  }
32
32
 
33
33
  /**
34
- * Rebuilds a key that {@link resolve} generated from its material. Returns `undefined` for the
35
- * empty material of the app's own key.
34
+ * Rebuilds an access key that {@link resolve} generated from its material. Returns `undefined` for the
35
+ * empty material of the app's own access key.
36
36
  */
37
37
  export function restore(
38
38
  material: Key.Material,
@@ -46,9 +46,9 @@ export function restore(
46
46
 
47
47
  export declare namespace resolve {
48
48
  type ReturnType = {
49
- /** A Viem account that signs with the key. */
49
+ /** A Viem account that signs with the access key. */
50
50
  accessKey: Account.Account
51
- /** What the authorization keeps to rebuild the key. Empty for the app's own key. */
51
+ /** What the authorization keeps to rebuild the access key. Empty for the app's own access key. */
52
52
  material: Key.Material
53
53
  }
54
54
  }
@@ -15,7 +15,7 @@ import type { Tokens } from '../Tokens.js'
15
15
  import type { User } from '../User.js'
16
16
 
17
17
  /**
18
- * Builds an authorization from Tempo ID's response and the sign-in's key: generated material, or
18
+ * Builds an authorization from Tempo ID's response and the sign-in's access key: generated material, or
19
19
  * the app's `accessKey`. Throws `server_error` for a response without the key authorization.
20
20
  */
21
21
  export function authorization<chainId extends number = number>(
@@ -26,7 +26,7 @@ export function authorization<chainId extends number = number>(
26
26
  },
27
27
  ): Authorization<chainId> {
28
28
  const { accessKey, material } = options
29
- // A response to a request with a key always carries one, so its absence is a fault.
29
+ // A response to a request with an access key always carries one, so its absence is a fault.
30
30
  if (!body.account || !body.key_authorization)
31
31
  throw new RequestError({
32
32
  code: 'server_error',
@@ -51,13 +51,13 @@ export function authorization<chainId extends number = number>(
51
51
 
52
52
  /** What the headless API returns for an authorization. */
53
53
  export type Headless = {
54
- /** The Tempo Account the key acts for, present for a request with a key. */
54
+ /** The Tempo Account the access key acts for, present for a request with an access key. */
55
55
  account?: Key.Key['account'] | undefined
56
56
  /** The signed key authorization, in RPC format, present for a request with a key. */
57
57
  key_authorization?: KeyAuthorization.Rpc | undefined
58
58
  /** The issued tokens, raw from the token endpoint or already read into `Tokens`. */
59
59
  tokens: TokenResponse | Tokens
60
- /** Present when the key's account waits for its upgrade, so the key signed as its own. */
60
+ /** Present when the access key's account waits for its upgrade, so the access key signed as its own. */
61
61
  upgrade_available?: true | undefined
62
62
  }
63
63
 
@@ -252,7 +252,7 @@ export async function token(auth: Id.Config, body: Record<string, string>) {
252
252
 
253
253
  /**
254
254
  * Builds the Viem account of a Tempo Account from Tempo ID's response, with its keys, the type of
255
- * the owner that signs its keys, and its realm. On a chain with configurable accounts, a passkey of
255
+ * the owner that signs its access keys, and its realm. On a chain with configurable accounts, a passkey of
256
256
  * the user's signs as an owner, through `getFn`. Elsewhere, the account holds its address alone.
257
257
  * Throws `server_error` for a configuration that does not derive the account's address.
258
258
  */
@@ -260,7 +260,7 @@ export function tempoAccount(
260
260
  account: TempoAccountResponse,
261
261
  options: tempoAccount.Options = {},
262
262
  ): TempoAccount.TempoAccount {
263
- // A configuration sorts its owners by address. A cloud wallet signs the account's keys whenever it
263
+ // A configuration sorts its owners by address. A cloud wallet signs the account's access keys whenever it
264
264
  // is an owner, so it names the account's owner before a passkey does.
265
265
  const owner =
266
266
  account.config.owners.find((entry) => entry.type !== 'webAuthn') ??
@@ -356,7 +356,7 @@ export type TempoAccountResponse = {
356
356
  export type TokenResponse = {
357
357
  /** The access token for the app's API requests. */
358
358
  access_token: string
359
- /** The Tempo Account the key acts for, present with `key_authorization`. */
359
+ /** The Tempo Account the access key acts for, present with `key_authorization`. */
360
360
  account?: Key.Key['account'] | undefined
361
361
  /** The access token's lifetime, in seconds. */
362
362
  expires_in: number
@@ -425,14 +425,14 @@ export declare namespace signedIn {
425
425
  }
426
426
  }
427
427
 
428
- /** Reads an authorization without a key: the tokens and the user. */
428
+ /** Reads an authorization without an access key: the tokens and the user. */
429
429
  export function withoutKey(body: Headless): WithoutKey {
430
430
  const tokens_ =
431
431
  'accessToken' in body.tokens ? body.tokens : tokens(body.tokens)
432
432
  return { ...tokens_, user: user(tokens_) }
433
433
  }
434
434
 
435
- /** An authorization without a key: the tokens and the user. */
435
+ /** An authorization without an access key: the tokens and the user. */
436
436
  export type WithoutKey = Omit<Authorization, 'accessKey' | 'key'>
437
437
 
438
438
  /** One owner of a Tempo Account, as the API returns it. */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The sessions of a backend's users, in a `Store`: each redirect in progress, and each session with
3
- * its tokens and key. Concurrent reads of one session share one refresh. `backend` and
3
+ * its tokens and access key. Concurrent reads of one session share one refresh. `backend` and
4
4
  * `DurableObject.sessions` run it.
5
5
  * @module
6
6
  */
@@ -218,7 +218,7 @@ export function create(
218
218
  if (refreshToken && !revoked.has(refreshToken))
219
219
  await Api.revoke(auth, { refreshToken })
220
220
  // A second revocation of the token counts as a reuse. A failed deletion therefore writes an
221
- // ended marker in place of the session: no tokens, no key, already expired, and dropped by
221
+ // ended marker in place of the session: no tokens, no access key, already expired, and dropped by
222
222
  // the store within `pendingLifetime`. A read or a retry finds nothing to send. Only when the
223
223
  // store refuses that write too does the token stay in `revoked`, so no call sends it again.
224
224
  await store.removeItem(sessionKey(id)).catch(async (error: unknown) => {
@@ -322,7 +322,7 @@ export declare namespace create {
322
322
 
323
323
  type ReturnType = {
324
324
  /**
325
- * Redeems the callback of `start` for the session `id`, and stores its tokens and key. Throws
325
+ * Redeems the callback of `start` for the session `id`, and stores its tokens and access key. Throws
326
326
  * {@link PendingNotFoundError} without a redirect in progress, and `Id.RequestError` for a
327
327
  * forged `state` or a refused code.
328
328
  */
@@ -478,7 +478,7 @@ type StoredPending = {
478
478
  * earlier release, which waits `pendingLifetime`.
479
479
  */
480
480
  lifetime?: number | undefined
481
- /** The state, the PKCE verifier, and any key's material. */
481
+ /** The state, the PKCE verifier, and any access key's material. */
482
482
  pending: Pending.Pending | Pending.WithoutKey
483
483
  }
484
484
 
@@ -13,7 +13,7 @@ import type * as TempoAccount from '../TempoAccount.js'
13
13
  import * as SignIn from './signIn.js'
14
14
 
15
15
  /**
16
- * Requests the app's tokens, and a key with permissions, for the user's Tempo ID session in the
16
+ * Requests the app's tokens, and an access key with permissions, for the user's Tempo ID session in the
17
17
  * browser, with no sign-in. Sets the instance's session, and returns it. Returns `undefined`, and
18
18
  * empties the session, when the browser holds no Tempo ID session.
19
19
  */
@@ -29,7 +29,7 @@ export async function authorize(
29
29
  const change = context.session.change({ restore: true })
30
30
  const permissions = SignIn.permissions(context, parameters.permissions)
31
31
 
32
- // The permissions may be absent, so the result may hold a key or not.
32
+ // The permissions may be absent, so the result may hold an access key or not.
33
33
  const result: Actions.authorize.ReturnType<number, boolean> =
34
34
  await Actions.authorize(config, {
35
35
  challenge: parameters.challenge,
@@ -47,7 +47,7 @@ export async function authorize(
47
47
  return undefined
48
48
  }
49
49
 
50
- // The key names the account. Without one, the session reads the account that Tempo ID selects.
50
+ // The access key names the account. Without one, the session reads the account that Tempo ID selects.
51
51
  const account =
52
52
  'key' in result
53
53
  ? undefined
@@ -74,10 +74,10 @@ export declare namespace authorize {
74
74
  challenge?: string | undefined
75
75
  /** Runs the ceremony of a passkey that owns the account, in place of `navigator.credentials.get`. */
76
76
  getFn?: Actions.authorize.Options['getFn']
77
- /** Whether a passkey that owns the account signs the key on the page. Defaults to `false`. */
77
+ /** Whether a passkey that owns the account signs the access key on the page. Defaults to `false`. */
78
78
  passkey?: boolean | undefined
79
79
  /**
80
- * What the key may do, a function that returns it, or `false` for no key. Defaults to the
80
+ * What the access key may do, a function that returns it, or `false` for no access key. Defaults to the
81
81
  * instance's `permissions`.
82
82
  */
83
83
  permissions?: SignIn.PermissionsOption
@@ -224,7 +224,7 @@ export declare namespace getAccount {
224
224
 
225
225
  /**
226
226
  * Upgrades a wallet.tempo passkey's account in place to a configurable account, when a sign-in
227
- * returns `upgradeAvailable: true`. The session's key registers first, so it keeps working after the
227
+ * returns `upgradeAvailable: true`. The session's access key registers first, so it keeps working after the
228
228
  * upgrade. The passkey signs once. Sets the session's account to the upgraded account, and returns
229
229
  * it.
230
230
  */
@@ -235,7 +235,7 @@ export async function upgradeAccount(
235
235
  const current = await context.session.load()
236
236
  const key = current?.key
237
237
  const upgraded = await Actions.account.upgrade(context.config, {
238
- // The session's own key signs its registration, also one with material that the store kept.
238
+ // The session's own access key signs its registration, also one with material that the store kept.
239
239
  ...(key && (key.keyPair || key.privateKey)
240
240
  ? { accessKey: Key.toAccount(Key.from(key)) }
241
241
  : {}),