Testing
Sign requests and mint sessions exactly as Storeware does, for your tests.
import { ... } from '@storeware/plugin-sdk/testing';signRequest
The storeware-signature header for a body, as Storeware would send it.
function signRequest(options: { secret: string; body: string; kind?: SignedRequestKind; timestampSeconds?: number; }): Promise<string>signedDelivery
A webhook delivery as a Request, signed for the shop's secret.
function signedDelivery(options: { secret: string; event: string; data?: unknown; storeId?: string; url?: string; }): Promise<Request>mintSession
A session token like the one the admin frames your home or panel with.
function mintSession(options: { secret: string; clientId: string; claims?: Partial<ExtensionSessionClaims>; ttlSeconds?: number; }): Promise<string>