Documentation / @frak-labs/core-sdk / actions / prepareSso
Function: prepareSso()
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
Parameters
client
The current Frak Client
args
The SSO parameters
Returns
Promise<PrepareSsoReturnType>
Object containing the generated ssoUrl
Example
// 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 });Remarks
For most use cases, just use openSso() which handles URL generation automatically.
Only use prepareSso() when you need explicit control over the URL.