@swype-org/react-sdk 0.1.19 → 0.1.21
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.
- package/dist/index.cjs +373 -408
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -4
- package/dist/index.d.ts +15 -4
- package/dist/index.js +373 -408
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -169,11 +169,16 @@ interface ListResponse<T> {
|
|
|
169
169
|
/** User configuration preferences */
|
|
170
170
|
interface UserConfig {
|
|
171
171
|
defaultAllowance?: number;
|
|
172
|
-
/**
|
|
172
|
+
/** Most recent registered WebAuthn passkey credential, or null if none registered */
|
|
173
173
|
passkey?: {
|
|
174
174
|
credentialId: string;
|
|
175
175
|
publicKey: string;
|
|
176
176
|
} | null;
|
|
177
|
+
/** All registered WebAuthn passkey credentials for this user */
|
|
178
|
+
passkeys?: {
|
|
179
|
+
credentialId: string;
|
|
180
|
+
publicKey: string;
|
|
181
|
+
}[];
|
|
177
182
|
}
|
|
178
183
|
/** Theme mode */
|
|
179
184
|
type ThemeMode = 'light' | 'dark';
|
|
@@ -300,11 +305,17 @@ type AccessTokenGetter = () => Promise<string | null | undefined>;
|
|
|
300
305
|
* Creates a WebAuthn passkey credential.
|
|
301
306
|
* Used for upfront passkey registration before the authorization flow.
|
|
302
307
|
*
|
|
303
|
-
* @param
|
|
304
|
-
* WebAuthn
|
|
308
|
+
* @param params.userId - Globally unique user identifier (e.g. Privy DID).
|
|
309
|
+
* Used as the WebAuthn `user.id` handle so each user gets a distinct
|
|
310
|
+
* credential slot on the authenticator.
|
|
311
|
+
* @param params.displayName - Human-readable label shown in the OS passkey
|
|
312
|
+
* prompt (e.g. the user's email address or name).
|
|
305
313
|
* @returns The base64-encoded credentialId and publicKey.
|
|
306
314
|
*/
|
|
307
|
-
declare function createPasskeyCredential(
|
|
315
|
+
declare function createPasskeyCredential(params: {
|
|
316
|
+
userId: string;
|
|
317
|
+
displayName: string;
|
|
318
|
+
}): Promise<{
|
|
308
319
|
credentialId: string;
|
|
309
320
|
publicKey: string;
|
|
310
321
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -169,11 +169,16 @@ interface ListResponse<T> {
|
|
|
169
169
|
/** User configuration preferences */
|
|
170
170
|
interface UserConfig {
|
|
171
171
|
defaultAllowance?: number;
|
|
172
|
-
/**
|
|
172
|
+
/** Most recent registered WebAuthn passkey credential, or null if none registered */
|
|
173
173
|
passkey?: {
|
|
174
174
|
credentialId: string;
|
|
175
175
|
publicKey: string;
|
|
176
176
|
} | null;
|
|
177
|
+
/** All registered WebAuthn passkey credentials for this user */
|
|
178
|
+
passkeys?: {
|
|
179
|
+
credentialId: string;
|
|
180
|
+
publicKey: string;
|
|
181
|
+
}[];
|
|
177
182
|
}
|
|
178
183
|
/** Theme mode */
|
|
179
184
|
type ThemeMode = 'light' | 'dark';
|
|
@@ -300,11 +305,17 @@ type AccessTokenGetter = () => Promise<string | null | undefined>;
|
|
|
300
305
|
* Creates a WebAuthn passkey credential.
|
|
301
306
|
* Used for upfront passkey registration before the authorization flow.
|
|
302
307
|
*
|
|
303
|
-
* @param
|
|
304
|
-
* WebAuthn
|
|
308
|
+
* @param params.userId - Globally unique user identifier (e.g. Privy DID).
|
|
309
|
+
* Used as the WebAuthn `user.id` handle so each user gets a distinct
|
|
310
|
+
* credential slot on the authenticator.
|
|
311
|
+
* @param params.displayName - Human-readable label shown in the OS passkey
|
|
312
|
+
* prompt (e.g. the user's email address or name).
|
|
305
313
|
* @returns The base64-encoded credentialId and publicKey.
|
|
306
314
|
*/
|
|
307
|
-
declare function createPasskeyCredential(
|
|
315
|
+
declare function createPasskeyCredential(params: {
|
|
316
|
+
userId: string;
|
|
317
|
+
displayName: string;
|
|
318
|
+
}): Promise<{
|
|
308
319
|
credentialId: string;
|
|
309
320
|
publicKey: string;
|
|
310
321
|
}>;
|