usePrepareSso
Ce contenu n’est pas encore disponible dans votre langue.
usePrepareSso(
params):UseQueryResult<PrepareSsoReturnType,Error>
Defined in: react/src/hook/usePrepareSso.ts:44
Hook that asks the wallet for an SSO URL without opening the popup
It’s a @tanstack/react-query!home | `tanstack` wrapper around the `prepareSso()` action
Parameters
Section titled “Parameters”params
Section titled “params”PrepareSsoParamsType
SSO parameters for URL generation
Returns
Section titled “Returns”UseQueryResult<PrepareSsoReturnType, Error>
The query hook wrapping the prepareSso() action, its data carrying the
generated ssoUrl
Example
Section titled “Example”function MyComponent() { const { data, isSuccess } = usePrepareSso({ metadata: { logoUrl: "..." }, directExit: true });
const handleClick = () => { if (data?.ssoUrl) { window.open(data.ssoUrl, "_blank"); } };
return <button onClick={handleClick} disabled={!isSuccess}>Login</button>;}- `prepareSso()` for the underlying action
- `openSso()` for the recommended high-level API