components/passkey/test
For AI agents: see llms.txt for the complete documentation index. Markdown versions are available by adding .md to a page URL or requesting Accept: text/markdown.
Variables
default
default: object;
Type Declaration
modules
modules: Record<string, () => Promise<unknown>>;
registerPasskey
registerPasskey: (t, name) => void;
Register the passkey component with a convex-test instance.
The component mounts the batch worker for its cleanup loop, so we register that
under <name>/batchWorker too — the same way it sits below the component when
the app app.uses the convex.config of the component.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
t | TestConvex<SchemaDefinition<GenericSchema, boolean>> | undefined | The test convex instance, e.g. from calling convexTest. |
name | string | "authPasskey" | The name of the component, as registered in convex.config.ts. |
Returns
void
schema
schema: SchemaDefinition<
{
challenges: TableDefinition<
VUnion<
| {
challenge: ArrayBuffer;
handleId: Id<"handles">;
kind: "registration";
}
| {
challenge: ArrayBuffer;
kind: "authentication";
purpose: string;
userId?: string;
},
[
VObject<
{
challenge: ArrayBuffer;
handleId: Id<"handles">;
kind: "registration";
},
{
challenge: VBytes<ArrayBuffer, "required">;
handleId: VId<Id<"handles">, "required">;
kind: VLiteral<"registration", "required">;
},
"required",
"kind" | "challenge" | "handleId"
>,
VObject<
{
challenge: ArrayBuffer;
kind: "authentication";
purpose: string;
userId?: string;
},
{
challenge: VBytes<ArrayBuffer, "required">;
kind: VLiteral<"authentication", "required">;
purpose: VString<string, "required">;
userId: VString<string | undefined, "optional">;
},
"required",
"kind" | "userId" | "challenge" | "purpose"
>,
],
"required",
"kind" | "userId" | "challenge" | "purpose" | "handleId"
>,
{
by_challenge: ["challenge", "_creationTime"];
by_userId: ["userId", "_creationTime"];
},
{},
{}
>;
handles: TableDefinition<
VObject<
{
handle: ArrayBuffer;
userId: string | null;
},
{
handle: VBytes<ArrayBuffer, "required">;
userId: VUnion<
string | null,
[VString<string, "required">, VNull<null, "required">],
"required",
never
>;
},
"required",
"userId" | "handle"
>,
{
by_handle: ["handle", "_creationTime"];
by_userId: ["userId", "_creationTime"];
},
{},
{}
>;
passkeys: TableDefinition<
VObject<
{
counter: number;
credentialId: ArrayBuffer;
name?: string;
publicKey: ArrayBuffer;
transports?: string[];
userId: string;
},
{
counter: VFloat64<number, "required">;
credentialId: VBytes<ArrayBuffer, "required">;
name: VString<string | undefined, "optional">;
publicKey: VBytes<ArrayBuffer, "required">;
transports: VArray<
string[] | undefined,
VString<string, "required">,
"optional"
>;
userId: VString<string, "required">;
},
"required",
| "userId"
| "transports"
| "name"
| "credentialId"
| "publicKey"
| "counter"
>,
{
by_credentialId: ["credentialId", "_creationTime"];
by_userId: ["userId", "_creationTime"];
},
{},
{}
>;
},
true
>;
Functions
registerPasskey()
function registerPasskey(t, name?): void;
Register the passkey component with a convex-test instance.
The component mounts the batch worker for its cleanup loop, so we register that
under <name>/batchWorker too — the same way it sits below the component when
the app app.uses the convex.config of the component.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
t | TestConvex<SchemaDefinition<GenericSchema, boolean>> | undefined | The test convex instance, e.g. from calling convexTest. |
name | string | "authPasskey" | The name of the component, as registered in convex.config.ts. |
Returns
void