basalt / subscriptions/src / LemonSqueezyGatewayOptions
Interface: LemonSqueezyGatewayOptions
Defined in: subscriptions/src/drivers/lemonsqueezy.ts:49
Properties
apiBase?
> optional apiBase?: string
Defined in: subscriptions/src/drivers/lemonsqueezy.ts:79
API base, for tests/mocks. Default: https://api.lemonsqueezy.com/v1
apiKey
> apiKey: string
Defined in: subscriptions/src/drivers/lemonsqueezy.ts:51
Lemon Squeezy API key (Bearer).
customerId?
> optional customerId?: (billableId) => string | Promise<string>
Defined in: subscriptions/src/drivers/lemonsqueezy.ts:59
Resolves the Lemon Squeezy Customer ID for a billable — required for the portal.
Parameters
billableId
string
Returns
string | Promise<string>
fetch?
> optional fetch?: (input, init?) => Promise<Response>
Defined in: subscriptions/src/drivers/lemonsqueezy.ts:77
Injected fetch (tests). Default: global fetch.
Parameters
input
string | URL | Request
init?
RequestInit
Returns
Promise<Response>
maxEventAgeSeconds?
> optional maxEventAgeSeconds?: number
Defined in: subscriptions/src/drivers/lemonsqueezy.ts:73
Optional replay window in seconds. Lemon Squeezy's X-Signature covers the body only — there is no signed timestamp — so a captured delivery stays valid forever and only the webhook dedupe store stops a replay. When set, an event whose data.attributes.updated_at (or created_at) is older than this, or missing, is rejected with WebhookInvalidError. Leave it unset if you re-send old events from the Lemon Squeezy dashboard. Default: off.
now?
> optional now?: () => number
Defined in: subscriptions/src/drivers/lemonsqueezy.ts:75
Clock in ms (tests), for maxEventAgeSeconds. Default: Date.now.
Returns
number
resolveBillableId?
> optional resolveBillableId?: (event) => string | undefined
Defined in: subscriptions/src/drivers/lemonsqueezy.ts:64
Extracts the billable id from a verified event. Default: reads meta.custom_data.billableId — which the checkout call sets.
Parameters
event
unknown
Returns
string | undefined
storeId
> storeId: string
Defined in: subscriptions/src/drivers/lemonsqueezy.ts:55
Lemon Squeezy Store ID (needed to create checkouts).
variantId
> variantId: (plan, period) => string
Defined in: subscriptions/src/drivers/lemonsqueezy.ts:57
Resolves the Lemon Squeezy Variant ID for a plan + billing period.
Parameters
plan
string
period
Returns
string
webhookSecret
> webhookSecret: string
Defined in: subscriptions/src/drivers/lemonsqueezy.ts:53
Webhook signing secret used to verify X-Signature.