Arguments
The ID of the user
The email address or username of the user
A human-readable display name for the user
A custom display name for the passkey being created
An additional origin to allow for passkey operations (beyond the default origin)
Successful Response
WebAuthn registration options to pass to your WebAuthn library
Error Types
The additionalAllowedOrigin field was not formatted correctly as a valid origin
The user has reached the maximum number of passkeys allowed
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}")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}");}{ ok: true, data: { registrationOptions: { /* pass this to your webauthn library */ } }}StartPasskeyRegistrationResponse( registration_options={ # pass this to your webauthn library })StartPasskeyRegistrationResponse( registrationOptions={ /* pass this to your webauthn library */ })StartPasskeyRegistrationResponse{ RegistrationOptions = { /* pass this to your webauthn library */ }}