openSso
Ce contenu n’est pas encore disponible dans votre langue.
openSso(
client,inputArgs):Promise<OpenSsoReturnType>
Defined in: actions/openSso.ts:68
Function used to open the SSO
Parameters
Section titled “Parameters”client
Section titled “client”The current Frak Client
inputArgs
Section titled “inputArgs”Returns
Section titled “Returns”Promise<OpenSsoReturnType>
Description
Section titled “Description”Two SSO flow modes:
Redirect Mode (openInSameWindow: true):
- Wallet generates URL and triggers redirect
- Used when redirectUrl is provided
Popup Mode (openInSameWindow: false/omitted):
- SDK generates URL client-side (or uses provided ssoPopupUrl)
- Opens popup synchronously (prevents popup blockers)
- Waits for SSO completion via postMessage
Example
Section titled “Example”First we build the sso metadata
// Build the metadataconst metadata: SsoMetadata = { logoUrl: "https://my-app.com/logo.png", homepageLink: "https://my-app.com",};Then, either use it with direct exit (and so user is directly redirected to your website), or a custom redirect URL
// Opens in popup, SDK generates URL automaticallyawait openSso(frakConfig, { directExit: true, metadata,});// Opens in same window with redirectawait openSso(frakConfig, { redirectUrl: "https://my-app.com/frak-sso", metadata, openInSameWindow: true,});// Advanced: provide custom SSO URLconst { ssoUrl } = await prepareSso(frakConfig, { metadata });await openSso(frakConfig, { metadata, ssoPopupUrl: `${ssoUrl}&custom=param`,});