You control the UI; the SDK handles discovery, passkeys, verifications, and session creation.
Headless integration is currently available only for custom Integrations.
Initialize the headless client
Begin by loading the OwnID WebSDK:JavaScript
headless instance and bind it to the user’s identifier (loginId).
window.ownidis available after loading the OwnID script.withContextreturns a new bound instance of the SDK to a specific context with aloginId.
Discover available operations
Ask the SDK what authentication options exist for this user in this environment.discover.operations to choose the flow order.
Passkey Authentication
If the device supports WebAuthn and this user has a passkey, try that first.- Find out if we expect passkey authentication to be available for the user if it’s listed in
discover.operations. isAvailable()to confirm browser support.start()triggers the passkey challenge.- When the challenge settles -
whenSettledresolves to success or error. - On success, we’ll attempt to create a session via
login(...). - On error, we can choose how to handle, e.g. fall back to email/phone.
Email Verification
Notice that in order for Email Verification to be available - your OwnID app needs to be configured with an SMTP provider for sending emails.
Phone Verification
Notice that in order for Phone Number Verification to be available - your OwnID app needs to be configured with an SMS provider for sending SMS messages.
Establish a Session
- After a successful login, estbalish your session with the
sessionPayloadyou’ve returned from the/getSessionintegration endpoint .
Recommended: Post-login Passkey Enrollment
- As passkey enrollment should be optional - failures should not affect the user-experience.