• Type Parameters

    Parameters

    • param: {
          clientId?: string;
          logger?: {
              changeLevel: (
                  level: "none" | "error" | "warn" | "info" | "debug",
              ) => void;
              debug: (...args: LogMessage[]) => void;
              error: (...args: LogMessage[]) => void;
              info: (...args: LogMessage[]) => void;
              warn: (...args: LogMessage[]) => void;
          };
          requestMiddleware?: RequestMiddleware<ActionType, unknown>[];
          store?: SdkStore;
      }

      Configuration options for the client store.

      • OptionalclientId?: string
      • Optionallogger?: {
            changeLevel: (
                level: "none" | "error" | "warn" | "info" | "debug",
            ) => void;
            debug: (...args: LogMessage[]) => void;
            error: (...args: LogMessage[]) => void;
            info: (...args: LogMessage[]) => void;
            warn: (...args: LogMessage[]) => void;
        }

        An optional logger for this client only.

      • OptionalrequestMiddleware?: RequestMiddleware<ActionType, unknown>[]

        Request middleware applied to this client's requests only.

      • Optionalstore?: SdkStore

        An existing SDK store to attach to. Omit to create one.

    Returns SdkStoreHandle<
        {
            oidc: CombinedState<
                {
                    authorizeFetch: MutationDefinition<
                        { url: string },
                        BaseQueryFn<
                            string
                            | FetchArgs,
                            unknown,
                            FetchBaseQueryError,
                            {},
                            FetchBaseQueryMeta,
                        >,
                        never,
                        AuthorizeSuccessResponse,
                        "oidc",
                        unknown,
                    >;
                    authorizeIframe: MutationDefinition<
                        { url: string },
                        BaseQueryFn<
                            string
                            | FetchArgs,
                            unknown,
                            FetchBaseQueryError,
                            {},
                            FetchBaseQueryMeta,
                        >,
                        never,
                        AuthorizationSuccess,
                        "oidc",
                        unknown,
                    >;
                    endSession: MutationDefinition<
                        { endpoint: string; idToken: string; signOutRedirectUri?: string },
                        BaseQueryFn<
                            string
                            | FetchArgs,
                            unknown,
                            FetchBaseQueryError,
                            {},
                            FetchBaseQueryMeta,
                        >,
                        never,
                        null,
                        "oidc",
                        unknown,
                    >;
                    exchange: MutationDefinition<
                        {
                            code: string;
                            config: OidcConfig;
                            endpoint: string;
                            verifier?: string;
                        },
                        BaseQueryFn<
                            string
                            | FetchArgs,
                            unknown,
                            FetchBaseQueryError,
                            {},
                            FetchBaseQueryMeta,
                        >,
                        never,
                        TokenExchangeResponse,
                        "oidc",
                        unknown,
                    >;
                    par: MutationDefinition<
                        { body: URLSearchParams; endpoint: string },
                        BaseQueryFn<
                            string
                            | FetchArgs,
                            unknown,
                            FetchBaseQueryError,
                            {},
                            FetchBaseQueryMeta,
                        >,
                        never,
                        PushAuthorizationResponse,
                        "oidc",
                        unknown,
                    >;
                    revoke: MutationDefinition<
                        { accessToken: string; clientId?: string; endpoint: string },
                        BaseQueryFn<
                            string
                            | FetchArgs,
                            unknown,
                            FetchBaseQueryError,
                            {},
                            FetchBaseQueryMeta,
                        >,
                        never,
                        object,
                        "oidc",
                        unknown,
                    >;
                    sessionCheckFetch: MutationDefinition<
                        { url: string },
                        BaseQueryFn<
                            string
                            | FetchArgs,
                            unknown,
                            FetchBaseQueryError,
                            {},
                            FetchBaseQueryMeta,
                        >,
                        never,
                        { status: 204 },
                        "oidc",
                        unknown,
                    >;
                    sessionCheckIframe: MutationDefinition<
                        { responseType: SessionCheckResponseType; url: string },
                        BaseQueryFn<
                            string
                            | FetchArgs,
                            unknown,
                            FetchBaseQueryError,
                            {},
                            FetchBaseQueryMeta,
                        >,
                        never,
                        { params: Record<string, string> },
                        "oidc",
                        unknown,
                    >;
                    userInfo: MutationDefinition<
                        { accessToken: string; endpoint: string },
                        BaseQueryFn<
                            string
                            | FetchArgs,
                            unknown,
                            FetchBaseQueryError,
                            {},
                            FetchBaseQueryMeta,
                        >,
                        never,
                        UserInfoResponse,
                        "oidc",
                        unknown,
                    >;
                },
                never,
                "oidc",
            >;
            wellknown: CombinedState<
                {
                    configuration: QueryDefinition<
                        string,
                        BaseQueryFn<
                            string
                            | FetchArgs,
                            unknown,
                            FetchBaseQueryError,
                            {},
                            FetchBaseQueryMeta,
                        >,
                        never,
                        WellknownResponse,
                        "wellknown",
                        unknown,
                    >;
                },
                never,
                "wellknown",
            >;
        },
    >

    • A handle to the store this client is mounted on.

    createClientStore

    Creates, or attaches to, the store backing an OIDC client.