@scayle/storefront-nuxt
Version:
Nuxt integration for the SCAYLE Commerce Engine and Storefront API
40 lines (39 loc) • 1.41 kB
TypeScript
import type { ShopUser, SessionCustomData } from '@scayle/storefront-core';
/** Interface for shop session data.*/
export interface ShopSessionData {
/** The shop user object containing detailed information about the current user. */
user?: ShopUser;
/**
* The OAuth 2.0 access token.
* @see https://www.rfc-editor.org/rfc/rfc6749#section-1.4
*/
accessToken?: string;
/**
* The OAuth 2.0 refresh token.
* @see https://www.rfc-editor.org/rfc/rfc6749#section-1.5
*/
refreshToken?: string;
shopId?: number;
/** The session custom data to be stored in the session. */
customData?: SessionCustomData;
}
declare module '@scayle/h3-session' {
interface SessionDataT extends ShopSessionData {
}
}
/**
* Middleware handler for bootstrapping the application.
*
* This sets up the necessary context for incoming requests,
* including session management, caching, and routing.
* It handles redirects when enabled and logs errors encountered during the process.
* Internal Nuxt URLs, favicon requests, and the /api/up endpoint are skipped.
*
* @see https://h3.unjs.io/guide/event-handler
*
* @param event The [H3 event object](https://h3.unjs.io/guide/event).
*
* @throws {Error} If something went wrong.
*/
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<void>>;
export default _default;