@scayle/storefront-nuxt
Version:
Nuxt integration for the SCAYLE Commerce Engine and Storefront API
23 lines (22 loc) • 1.28 kB
TypeScript
import type { MaybeRefOrGetter } from 'vue';
import type { RpcMethodParameters } from '@scayle/storefront-core';
import type { UseRpcReturn, UseRpcCacheKey } from './useRpc.js';
/**
* The shape of the data returned by the `getExternalIdpRedirect` RPC call.
*/
type UseIDPBaseReturn = Pick<Awaited<UseRpcReturn<'getExternalIdpRedirect'>>, 'data' | 'error' | 'status' | 'refresh'>;
/**
* Retrieves an external IDP redirect URL.
*
* This composables uses the `useRpc` composable to call the `getExternalIdpRedirect` RPC method.
*
* @see https://scayle.dev/en/core-documentation/storefront-guide/storefront-application/technical-foundation/sessions#idp-redirect-url
*
* @param params The parameters for the `getExternalIdpRedirect` RPC call.
* @param key A unique key for the RPC call. Used for caching and invalidation. Defaults to 'useIDP'.
* @returns An object containing the `data` returned from, any `error` encountered within,
* the current `status` and a function to manually `refresh` the RPC call.
* It also acts as a promise that resolves to the same object.
*/
export declare function useIDP(params?: MaybeRefOrGetter<RpcMethodParameters<'getExternalIdpRedirect'>>, key?: UseRpcCacheKey): UseIDPBaseReturn & Promise<UseIDPBaseReturn>;
export {};