import type { DeepPartial } from "keycloakify/tools/DeepPartial"; import type { ExtendKcContext } from "./getKcContextFromWindow"; import { createGetKcContext } from "./createGetKcContext"; /** NOTE: We now recommend using createGetKcContext instead of this function to make storybook integration easier * See: https://github.com/keycloakify/keycloakify-starter/blob/main/src/keycloak-theme/account/kcContext.ts */ export function getKcContext(params?: { mockPageId?: ExtendKcContext["pageId"]; mockData?: readonly DeepPartial>[]; }): { kcContext: ExtendKcContext | undefined } { const { mockPageId, mockData } = params ?? {}; const { getKcContext } = createGetKcContext({ mockData }); const { kcContext } = getKcContext({ mockPageId }); return { kcContext }; }