usePrepareSso
usePrepareSso(
params):UseQueryResult<PrepareSsoReturnType,Error>
Defined in: react/src/hook/usePrepareSso.ts:43
Hook that generates SSO URL for popup flow
This is a synchronous hook (no async calls) that generates the SSO URL client-side without communicating with the wallet iframe.
Parameters
Section titled “Parameters”params
Section titled “params”PrepareSsoParamsType
SSO parameters for URL generation
Returns
Section titled “Returns”UseQueryResult<PrepareSsoReturnType, Error>
Object containing:
ssoUrl: Generated SSO URL (or undefined if client not ready)isReady: Boolean indicating if URL is available
Example
Section titled “Example”function MyComponent() { const { data } = usePrepareSso({ metadata: { logoUrl: "..." }, directExit: true });
const handleClick = () => { if (ssoUrl) { window.open(data?.ssoUrl, "_blank"); } };
return <button onClick={handleClick} disabled={!isReady}>Login</button>;}- `prepareSso()` for the underlying action
- `openSso()` for the recommended high-level API