Initiates the passkey registration process for a user. This generates WebAuthn registration options that should be passed to your WebAuthn library on the client side.
Arguments
userId string required
The ID of the user
emailOrUsername string required
The email address or username of the user
userDisplayName string
A human-readable display name for the user
passkeyDisplayName string
A custom display name for the passkey being created
additionalAllowedOrigin string
An additional origin to allow for passkey operations (beyond the default origin)
Successful Response
registrationOptions object
WebAuthn registration options to pass to your WebAuthn library
Error Types
CannotParseAdditionalAllowedOrigin
The additionalAllowedOrigin field was not formatted correctly as a valid origin
TooManyPasskeys
The user has reached the maximum number of passkeys allowed
UnexpectedError
An unexpected error occurred during the operation
const auth = createClient({ url, integrationKey });
const result = await auth.passkeys.startRegistration({ userId: "1189c444-8a2d-4c41-8b4b-ae43ce79a492", emailOrUsername: "user@example.com", userDisplayName: "Example User", passkeyDisplayName: "My MacBook", additionalAllowedOrigin: "https://app.example.com",});
if (result.ok) { console.log("Registration started successfully"); // Pass registrationOptions to your WebAuthn library res.json({ registrationOptions: result.data.registrationOptions });} else { console.log(`Error: ${result.error}`); // Check result.error.type to handle specific errors}client = create_client(url=url, integration_key=integration_key)
result = await client.passkeys.start_registration( user_id="1189c444-8a2d-4c41-8b4b-ae43ce79a492", email_or_username="user@example.com", user_display_name="Example User", passkey_display_name="My MacBook", additional_allowed_origin="https://app.example.com")
if is_ok(result): print("Registration started successfully") # Pass registration_options to your WebAuthn library return JSONResponse({"registrationOptions": result.data.registration_options})else: print(f"Error: {result.error}")client, err := byo.NewClient(url, integrationKey)if err != nil { log.Fatal(err)}
result, err := client.Passkeys.StartRegistration(ctx, byo.StartPasskeyRegistrationCommand{ UserID: "1189c444-8a2d-4c41-8b4b-ae43ce79a492", EmailOrUsername: "user@example.com", UserDisplayName: byo.String("Example User"), PasskeyDisplayName: byo.String("My MacBook"), AdditionalAllowedOrigin: byo.String("https://app.example.com"),})if err != nil { log.Fatal(err)}
fmt.Println(string(result.RegistrationOptions))PropelAuthClient client = PropelAuthClient.create(url, integrationKey);
StartPasskeyRegistrationCommand command = StartPasskeyRegistrationCommand.builder() .userId("1189c444-8a2d-4c41-8b4b-ae43ce79a492") .emailOrUsername("user@example.com") .userDisplayName("Example User") .passkeyDisplayName("My MacBook") .additionalAllowedOrigin("https://app.example.com") .build();
try { StartPasskeyRegistrationResponse response = client.passkeys.startRegistration(command); System.out.println("Registration started successfully"); // Pass registrationOptions to your WebAuthn library} catch (StartPasskeyRegistrationException.TooManyPasskeys e) { System.out.println("Too many passkeys: " + e.getDetails());} catch (StartPasskeyRegistrationException e) { System.out.println("Error: " + e.getMessage());}var client = new PropelAuthClient(new PropelAuthOptions { Url = url, IntegrationKey = integrationKey });
var command = new StartPasskeyRegistrationCommand{ UserId = "1189c444-8a2d-4c41-8b4b-ae43ce79a492", EmailOrUsername = "user@example.com", UserDisplayName = "Example User", PasskeyDisplayName = "My MacBook", AdditionalAllowedOrigin = "https://app.example.com"};
try{ var response = await client.Passkeys.StartRegistrationAsync(command); Console.WriteLine("Registration started successfully"); // Pass RegistrationOptions to your WebAuthn library}catch (StartPasskeyRegistrationException.TooManyPasskeys ex){ Console.WriteLine("Too many passkeys");}catch (StartPasskeyRegistrationException ex){ Console.WriteLine($"Error: {ex.Message}");}
Response
{ ok: true, data: { registrationOptions: { /* pass this to your webauthn library */ } }}StartPasskeyRegistrationResponse( registration_options={ # pass this to your webauthn library })byo.StartPasskeyRegistrationResponse{ RegistrationOptions: json.RawMessage("{}"), // pass this to your webauthn library}StartPasskeyRegistrationResponse( registrationOptions={ /* pass this to your webauthn library */ })StartPasskeyRegistrationResponse{ RegistrationOptions = { /* pass this to your webauthn library */ }}