startAveAuth, mountAveEmbed, openAveSheet, and openAvePopup return promises. Await the result before using its controls. Connector and signing helpers return their controls synchronously.
Provide onTokens to handle PKCE, state, nonce, and the token exchange automatically. Granted encryption keys, previous keys, and the app_key_reset recovery flag are included from the callback fragment. Profile and email fields depend on the granted scopes.
clientId in startAveAuth to use Quick Ave for your callback origin. Supply onSuccess instead of onTokens for your own callback and code exchange. Public clients using onSuccess must persist their PKCE verifier, state, and nonce themselves.
UI patterns
Inline embed
Mount an iframe directly in a container element. Stays in page, no overlay. Good for dedicated auth pages.
Sheet
Slides up from the bottom as a fixed modal overlay. Good for triggering login from any page.
Popup
Opens a new browser window. Works well on desktop. Returns
null if the browser blocks the popup.Auth flows
mountAveEmbed(options)
Mounts an Ave auth iframe inside a container element. The iframe stays visible while the user completes login.
HTMLElement
required
The DOM element that will contain the iframe.
string
required
Your app’s client ID.
string
required
Registered redirect URI.
string
default:"\"openid profile email\""
Space-separated scopes.
(payload) => void
Called when the user completes login.
payload.redirectUrl is the callback URL with the authorization code.(payload) => void
Called on error.
payload.error is the error string, payload.message is a human-readable description.() => void
Called when the user closes the embed without completing auth.
openAveSheet(options)
Opens a full-width sheet overlay from the bottom. Non-blocking — the user can dismiss it.
onTokens flow reports popup_blocked so the app can invite the user to allow popups and retry. An application-managed onSuccess flow redirects the current page to Ave; persist callback state before opening it.
openAvePopup(options)
Opens a popup window for Ave auth. Returns null if the browser blocked the popup — always handle that case.
number
default:"450"
Popup window width in pixels.
number
default:"650"
Popup window height in pixels.
Connector flows
openAveConnectorSheet(options) / openAveConnectorPopup(options)
Opens /connect for Connector consent in a sheet or popup. Both helpers return controls synchronously.
string
required
The target resource key.
string
The resource scope(s) to request.
string
default:"\"user_present\""
Communication mode:
"user_present" or "background".openAveConnectorRuntime(options)
Mounts a Connector runtime iframe for active connector sessions where the source app communicates with the target resource UI.
string
required
The delegated access token from the token-exchange grant.
HTMLElement
DOM element to mount the runtime iframe in.
() => void
Called when the runtime iframe is ready to receive messages.
(payload) => void
Called for events sent from the runtime iframe.
Signing flows
openAveSigningSheet(options)
Opens the signing UI as a sheet overlay and includes the embedding origin for result delivery.
string
required
The signing request ID from
createSignatureRequest.(payload) => void
Called when the user approves and signs.
(payload) => void
Called when the user explicitly denies the request.
() => void
Called when the user closes the sheet without acting.
openAveSigningPopup(options)
Same as sheet but in a popup window.
null if the popup was blocked. Fall back to sheet.
Security rules
- Always call
destroy()orclose()when the component unmounts to remove event listeners and clean up iframes - Handle success, error, and dismissal.
onClosefires once for dismissal; successful or failed completion does not also call it - Do not use popups as the primary UX on mobile — fall back to sheet
- The embed does not work inside sandboxed iframes that restrict credentials or passkey access
