Skip to main content
The headless SDK lets you run the full OwnID authentication flow without any pre-built UI components.
You control the UI; the SDK handles discovery, passkeys, verifications, and session creation.
Headless integration is currently available only for custom Integrations.
Prefer to start from code? Skip to the full example.

Initialize the headless client

Begin by loading the OwnID WebSDK:
JavaScript
Once loaded, get the headless instance and bind it to the user’s identifier (loginId).
Notes:
  • window.ownid is available after loading the OwnID script.
  • withContext returns a new bound instance of the SDK to a specific context with a loginId.

Discover available operations

Ask the SDK what authentication options exist for this user in this environment.
You’ll use discover.operations to choose the flow order.

Passkey Authentication

If the device supports WebAuthn and this user has a passkey, try that first.
What’s happening:
  • 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 - whenSettled resolves 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

Notes:

Recommended: Post-login Passkey Enrollment

Notes:
  • As passkey enrollment should be optional - failures should not affect the user-experience.

Full example