getCustomerContext
Gets the shopper's context based on the shopperJWT.
Calls the getShopperContext endpoint exposed by SCAPI.
You can use this method to fetch information about the current customer's shopper context. The context is determined based on the provided JWT.
Signature
export declare function getCustomerContext(
): Promise<CustomerContext>;Returns
Returns a representation of a Customer Context.
Referenced Types
CustomerContext
Examples
Fetching the current customer's context.
import { sdk } from '~/sdk.config.ts';
const customer = await sdk.commerce.getCustomerContext();