Aller au contenu

usePrepareSso

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

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.

PrepareSsoParamsType

SSO parameters for URL generation

UseQueryResult<PrepareSsoReturnType, Error>

Object containing:

  • ssoUrl: Generated SSO URL (or undefined if client not ready)
  • isReady: Boolean indicating if URL is available
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>;
}