Aller au contenu

prepareSso

Ce contenu n’est pas encore disponible dans votre langue.

prepareSso(client, args): Promise<PrepareSsoReturnType>

Defined in: actions/prepareSso.ts:38

Generate SSO URL without opening popup

This is a synchronous, client-side function that generates the SSO URL without any RPC calls to the wallet iframe. Use this when you need:

  • Custom URL modifications before opening popup
  • Pre-generation for advanced popup strategies
  • URL inspection/logging before SSO flow

FrakClient

The current Frak Client

PrepareSsoParamsType

The SSO parameters

Promise<PrepareSsoReturnType>

Object containing the generated ssoUrl

// Generate URL for inspection
const { ssoUrl } = prepareSso(client, {
metadata: { logoUrl: "..." },
directExit: true
});
console.log("Opening SSO:", ssoUrl);
// Add custom params
const customUrl = `${ssoUrl}&tracking=abc123`;
await openSso(client, { metadata, ssoPopupUrl: customUrl });

For most use cases, just use openSso() which handles URL generation automatically. Only use prepareSso() when you need explicit control over the URL.