Overview
Signs up a user using a passkey, creating a new sub-organization and session.
- This function creates a new passkey authenticator and uses it to register a new sub-organization for the user.
- Handles both passkey creation and sub-organization creation in a single flow.
- Optionally accepts additional sub-organization parameters, a custom session key, a custom passkey display name, and a custom session expiration.
- Automatically generates a new API key pair for authentication and session management.
- Stores the resulting session token and manages cleanup of unused key pairs.
Package: core
Defined in: clients/core.ts:460
Parameters
challenge string to use for passkey registration. If not provided, a new challenge will be generated.
params.createSubOrgParams
parameters for creating a sub-organization (e.g., authenticators, user metadata).
Show createSubOrgParams details
params.createSubOrgParams.apiKeys
params.createSubOrgParams.authenticators
params.createSubOrgParams.customWallet
custom wallets to create during sub-org creation time
Show customWallet details
params.createSubOrgParams.customWallet.walletAccounts
v1WalletAccountParams[]
requiredlist of wallet accounts to create
params.createSubOrgParams.customWallet.walletName
name of the wallet created
params.createSubOrgParams.oauthProviders
params.createSubOrgParams.subOrgName
name of the sub-organization
params.createSubOrgParams.userEmail
params.createSubOrgParams.userName
params.createSubOrgParams.userPhoneNumber
params.createSubOrgParams.userTag
params.createSubOrgParams.verificationToken
verification token if email or phone number is provided
session expiration time in seconds (defaults to the configured default).
organization ID to target (defaults to the session’s organization ID or the parent organization ID).
params.passkeyDisplayName
display name for the passkey (defaults to a generated name based on the current timestamp).
session key to use for storing the session (defaults to the default session key).
Response
A successful response returns the following fields:
returns
PasskeyAuthResult
required
A promise that resolves to a PasskeyAuthResult, which includes:
sessionToken
: the signed JWT session token.
credentialId
: the credential ID associated with the passkey created.