Skip to content

Search docs

Jump between documentation pages.

Browse docs

Payment & commerce integrations

DaloyJS treats payment providers the same way it treats email senders and database clients: wrap the provider SDK in a small plugin function that decorates the root app (handlers read it from ctx.state), and call it from validated route handlers. That keeps your business logic provider-agnostic so you can swap or A/B providers later.

Supported providers

One abstraction, many gateways
business logicYour route handlerscall state.<provider>
Stripestripe
Shopifyshopify-api-node
Braintreebraintree
Authorize.Netauthorizenet
Adyen@adyen/api-library
Molliemollie-api-typescript
Tap / PayTabsREST / paytabs_pt2
Razorpayrazorpay
Squaresquare
PayPalOrders v2 REST
Paddle@paddle/paddle-node-sdk
Checkout.comcheckout-sdk-node
Each provider SDK lives behind a small plugin function that decorates the root app, so your handlers stay provider-agnostic and you can swap or A/B gateways without rewriting routes.
  • Stripe: hosted Checkout Sessions built from server-side Price IDs, a plain redirect to session.url, and constructEventAsync webhook verification that also runs on Workers.
  • Shopify: the GraphQL Admin API through the community shopify-api-node SDK, Dev Dashboard app credentials, and X-Shopify-Hmac-SHA256 webhooks keyed with the app client secret.
  • Braintree (PayPal): PayPal, cards, Venmo, Apple Pay, and Google Pay through the official braintree SDK, with session-scoped client tokens and SDK-verified webhooks.
  • Authorize.Net: Accept.js nonces charged through the official authorizenet SDK, duplicateWindow protection, and HMAC-SHA512 webhook verification.
  • Adyen: the Sessions flow for Drop-in / Components via @adyen/api-library, hmacValidator for Standard webhooks, and core basicAuth() on the webhook route.
  • Mollie: mollie-api-typescript with both classic per-payment webhooks (unsigned, refetch) and next-gen signed webhooks (X-Mollie-Signature).
  • Tap Payments: GCC and MENA acquiring over the REST Charges API with resilientFetch, reference.idempotent, and hashstring verification.
  • PayTabs: MENA acquiring via the official paytabs_pt2 package, wrapped as a Promise-friendly plugin with HMAC-SHA256 IPN verification.
  • Razorpay: UPI, cards, netbanking, and wallets via the Orders flow, with both the checkout callback signature and X-Razorpay-Signature webhooks verified by core helpers.
  • Square: the square TypeScript SDK, bigint money amounts, Web Payments SDK tokens, and the async WebhooksHelper.verifySignature.
  • PayPal Checkout: Orders v2 over REST with cached OAuth tokens, PayPal-Request-Id idempotency, server-side capture, and verify-webhook-signature postback (or certificate self-verification on Node).
  • Paddle Billing: a merchant of record that handles tax, with server-created transactions opened in Paddle.js and Paddle-Signature verified by core verifyWebhookSignature().
  • Checkout.com: Flow payment sessions through checkout-sdk-node, account-prefixed base URLs, Cko-Idempotency-Key on payment actions, and Cko-Signature webhooks.

PayPal wallets are available either directly through PayPal Checkout or through the Braintree gateway. Each provider follows the same plugin shape so you can drop a new one into an existing application without rewriting routes.

What every payment integration needs

  • Server-side secrets only. Secret keys, webhook signing secrets, and OAuth access tokens belong in environment variables, never in the browser bundle or in a Next.js client component.
  • Server-side amounts. The browser sends an order id (or SKUs and quantities). The server loads the price and currency from its own records. See never trust client amounts.
  • Webhook verification. Most providers sign their webhooks; Mollie's classic payment webhooks are unsigned and only carry an id you must refetch. Verify the signature on the raw request body before parsing it. A route without a request.body schema leaves the raw body readable (capped by bodyLimitBytes), so readBodyLimited() sees the exact bytes the provider signed.
  • Dedupe and fast acknowledgement. Providers retry, and deliveries arrive out of order. Dedupe atomically on the provider's event id, enqueue the work, and return 2xx quickly. See the webhook pattern.
  • Idempotency on outbound calls. Derive provider idempotency keys from your own order id (plus a cart version), never from a fresh random UUID per call. Use idempotency() for retries of your own POST /checkout.
  • Scoped rate limits and CSRF. Limit and CSRF-protect the browser-facing checkout and refund routes, and exempt the webhook routes. Providers call webhooks from their own infrastructure, without your cookies or CSRF token.
  • Error mapping. Surface provider failures through problem+json so clients (and typed clients) see a consistent error shape. Log the provider's detail; do not forward it to the client.

Never trust client amounts

Every provider guide uses the same small, illustrative order module. Back it with your own database; the important parts are the ownership check, the server-side total, and the conditional pending -> paid transition:

src/orders.tsts
import { ConflictError, JobFatalError, NotFoundError, UnauthorizedError } from "@daloyjs/core";
import { db } from "./db.ts"; // your persistence layer

export interface Order {
  id: string;
  userId: string;
  status: "pending" | "paid" | "refunded" | "partially_refunded";
  currency: string;    // ISO 4217, uppercase
  amountMinor: number; // computed on the server from your catalogue
  version: number;     // bumped on every cart change
  lines: Array<{ sku: string; name: string; quantity: number; unitMinor: number; stripePriceId?: string }>;
  providerRef?: string; // PaymentIntent id, pspReference, tran_ref, ...
  capturedMinor: number;
  refundedMinor: number;
}

export const orders = {
  /** Load an order the signed-in user owns and that still awaits payment. */
  async forCheckout(orderId: string, userId: string | undefined): Promise<Order> {
    if (!userId) throw new UnauthorizedError("Sign in to check out.");
    const order = await db.orders.get(orderId);
    // Same 404 for "missing" and "not yours", so ids cannot be probed.
    if (!order || order.userId !== userId) throw new NotFoundError("Order not found.");
    if (order.status !== "pending") throw new ConflictError("Order is not awaiting payment.");
    return order;
  },

  /** Called from the webhook worker after refetching the payment from the provider. */
  async markPaid(orderId: string, paid: { amountMinor: number; currency: string; providerRef: string }) {
    const order = await db.orders.get(orderId);
    if (!order) throw new JobFatalError(`unknown order ${orderId}`);
    if (order.amountMinor !== paid.amountMinor || order.currency !== paid.currency.toUpperCase()) {
      await db.orders.flagForReview(orderId, "paid amount or currency does not match");
      throw new JobFatalError(`amount mismatch on ${orderId}`);
    }
    // UPDATE ... SET status = 'paid' WHERE id = ? AND status = 'pending'
    await db.orders.transitionToPaid(orderId, paid.providerRef);
  },
};

Providers disagree on money formats (integer minor units, decimal strings, decimal numbers, bigint), so convert at the plugin edge with one helper:

src/money.tsts
// ISO 4217 minor-unit exponents. Extend for the currencies you sell in.
const ZERO_DECIMALS = new Set(["JPY", "KRW", "VND", "CLP", "ISK", "XAF", "XOF"]);
const THREE_DECIMALS = new Set(["KWD", "BHD", "OMR", "JOD", "TND", "IQD", "LYD"]);

export function currencyDecimals(currency: string): number {
  const c = currency.toUpperCase();
  if (ZERO_DECIMALS.has(c)) return 0;
  if (THREE_DECIMALS.has(c)) return 3;
  return 2;
}

/** 1050 + "EUR" -> "10.50"; 1050 + "KWD" -> "1.050". String math, no floats. */
export function formatMinor(minor: number, currency: string): string {
  const d = currencyDecimals(currency);
  const digits = String(Math.abs(minor)).padStart(d + 1, "0");
  const sign = minor < 0 ? "-" : "";
  return d === 0 ? sign + digits : `${sign}${digits.slice(0, -d)}.${digits.slice(-d)}`;
}

/** "10.50" or 10.5 + "EUR" -> 1050. Rejects more decimals than the currency has. */
export function toMinor(value: string | number, currency: string): number {
  const d = currencyDecimals(currency);
  const text = typeof value === "number" ? value.toFixed(d) : value;
  const m = /^(\d+)(?:\.(\d+))?$/.exec(text);
  if (!m || (m[2]?.length ?? 0) > d) throw new Error(`invalid ${currency} amount: ${text}`);
  return Number(m[1] + (m[2] ?? "").padEnd(d, "0"));
}
Currency examplesDecimals10 units in minor units
JPY, KRW010
USD, EUR, GBP, SAR, AED, QAR, EGP, INR21000
KWD, BHD, OMR, JOD310000

Some providers deviate from ISO 4217 for specific currencies, so check each provider's currency table before you add a new market.

The webhook pattern

Verify, dedupe, enqueue, acknowledge
  1. 01routeVerifysignature over the raw bytes
  2. 02jobIdempotencyKeyDedupeatomic on provider event id
  3. 03routeEnqueueapp.jobs.enqueue({ ... })
  4. 04workerAck 2xx fastrefetch + fulfil in the worker
The route only proves authenticity and records the event. The job store's atomic idempotency key collapses provider retries into one job, and the worker refetches the payment and fulfils idempotently.

A check-then-act dedupe (if (await seen(id)) return; ... markSeen(id)) races: two concurrent retries both pass the check. Instead, let the job queue do the dedupe. JobStore.put is atomic on the idempotency key, so a second enqueue with the same jobIdempotencyKey() returns the existing job with duplicate: true instead of creating another one.

src/webhooks/razorpay.tsts
import { readBodyLimited, safeJsonParse, verifyWebhookSignature, jobIdempotencyKey } from "@daloyjs/core";

app.post(
  "/webhooks/razorpay",
  {
    operationId: "razorpayWebhook",
    // No request.body schema: the raw bytes stay readable for the HMAC check.
    responses: {
      200: { description: "ack", body: z.object({ ok: z.literal(true) }) },
      400: { description: "malformed delivery", body: z.object({ error: z.string() }) },
      401: { description: "bad signature", body: z.object({ error: z.string() }) },
    },
  },
  async ({ request }) => {
    // 1. Verify over the exact bytes the provider signed.
    const raw = await readBodyLimited(request, 1_048_576);
    const ok = await verifyWebhookSignature({
      payload: raw,
      signature: request.headers.get("x-razorpay-signature") ?? "",
      secret: process.env.RAZORPAY_WEBHOOK_SECRET!,
      algorithm: "sha256",
    });
    if (!ok) return { status: 401, body: { error: "invalid signature" } };

    const eventId = request.headers.get("x-razorpay-event-id");
    if (!eventId) return { status: 400, body: { error: "missing event id" } };
    const event = safeJsonParse(new TextDecoder().decode(raw)) as { event: string };

    // 2 + 3. Atomic dedupe and enqueue in one call. Keep the payload small and
    // deterministic: the same event id must always produce the same payload.
    await app.jobs!.enqueue({
      name: "razorpay.event",
      payload: { eventId, type: event.event },
      idempotencyKey: jobIdempotencyKey({ name: "razorpay.event", key: eventId }),
    });

    // 4. Ack fast. The worker refetches the payment and calls orders.markPaid().
    return { status: 200, body: { ok: true as const } };
  },
);

Register the worker once per app with app.useJobs(). If you integrate several providers, put all their handlers in the same map:

src/app.tsts
import { App, MemoryJobStore } from "@daloyjs/core";

app.useJobs({
  store: new MemoryJobStore(), // dev only: use a durable JobStore adapter in production
  startWorker: true,           // long-lived processes only, never on Workers / Lambda
  handlers: {
    "razorpay.event": handleRazorpayEvent,
    "stripe.event": handleStripeEvent,
  },
});

Delivery is at-least-once, so the worker must be idempotent too: refetch the authoritative state from the provider, compare amount and currency with the stored order, and use the conditional pending -> paid update. See delivery semantics and the webhook recipe.

Shared app wiring

Every provider guide assumes this wiring. CSRF protection and the rate limit apply to the browser-facing checkout and refund routes; webhook routes are exempt because the provider calls them server to server, authenticated by the signature instead:

src/app.tsts
import { App, csrf, except, rateLimit, secureHeaders, session } from "@daloyjs/core";

// Declare your real proxy topology so rate limits and client IPs are correct.
const app = new App({ behindProxy: { hops: 1 } });

app.use(secureHeaders());
app.use(session({ secret: process.env.SESSION_SECRET! }));
app.use(except(["/webhooks/**"], csrf()));
app.use(except(["/webhooks/**"], rateLimit({ windowMs: 60_000, max: 30 })));

See CSRF protection, sessions, and trusted proxies. If your checkout API is called with bearer tokens instead of cookies, swap session() for jwk() and drop csrf().

To make your own POST /checkout safe to retry, mount idempotency() on it. With cookie sessions, scope keys by the session user so one shopper can never replay another's response:

ts
import { idempotency } from "@daloyjs/core";

// Assumes the AppState augmentation from the sessions guide (session: SessionContext).
const checkoutIdempotency = idempotency({
  scope: (ctx) => ctx.state.session.get<string>("userId"),
});
// app.post("/checkout/...", { hooks: checkoutIdempotency, ... }, handler)

Protected refunds

Refunds move money out of your account, so treat them as an admin operation: authenticate, require a role, check ownership (tenant or merchant), cap the amount at what was captured minus what was already refunded, and write an audit record. Every provider guide links here from its refund section.

src/routes/refunds.tsts
import { z } from "zod";
import { ConflictError, NotFoundError, every, jwk, requireRoles } from "@daloyjs/core";
import { db } from "../db.ts";

const staffOnly = every(
  jwk({ jwks, algorithms: ["RS256"], issuer, audience }), // stamps ctx.state.user
  requireRoles(["Payments.Refund"]),
);

app.post(
  "/admin/orders/:orderId/refunds",
  {
    operationId: "refundOrder",
    hooks: staffOnly,
    request: {
      params: z.object({ orderId: z.string().min(1).max(80) }),
      body: z.object({
        amountMinor: z.number().int().positive(),
        reason: z.enum(["requested_by_customer", "duplicate", "fraudulent"]),
      }).strict(),
    },
    responses: {
      201: { description: "refund created", body: z.object({ refundId: z.string() }) },
    },
  },
  async ({ params, body, state }) => {
    const staff = state.user as { sub: string; claims: { merchant_id?: string } };
    const order = await db.orders.get(params.orderId);
    // Ownership: staff of merchant A must not refund merchant B's orders.
    if (!order || order.merchantId !== staff.claims.merchant_id) throw new NotFoundError("Order not found.");

    const refundable = order.capturedMinor - order.refundedMinor;
    if (body.amountMinor > refundable) throw new ConflictError("Refund exceeds the captured amount.");

    const refund = await state.stripe.refund({
      paymentIntent: order.providerRef!,
      amount: body.amountMinor,
      // Stable per logical refund: a retry of the same request cannot refund twice.
      idempotencyKey: `refund:${order.id}:${order.refundedMinor}:${body.amountMinor}`,
    });

    await db.orders.addRefund(order.id, body.amountMinor, refund.id);
    await db.audit.write({
      action: "payment.refund",
      actor: staff.sub,
      orderId: order.id,
      amountMinor: body.amountMinor,
      reason: body.reason,
      providerRefundId: refund.id,
    });
    return { status: 201, body: { refundId: refund.id } };
  },
);

Combine the amount check with a row lock or a conditional update in your database so two concurrent refunds cannot both pass it. See resource authorization and administrator access.

Webhook verification matrix

Built from each provider's documentation as of October 2026. Confirm against the provider docs before relying on a cell; providers change these details.

ProviderHeader / fieldAlgorithm, encodingKeySigned inputTimestamp / replayDedupe id
StripeStripe-Signature (t=, v1=)HMAC-SHA256, hexendpoint whsec_ secrett, a dot, then the raw bodyt, SDK tolerance 300 sevent.id
ShopifyX-Shopify-Hmac-SHA256HMAC-SHA256, base64app client secretraw bodynone signedX-Shopify-Webhook-Id
Braintreebt_signature form fieldverified by webhookNotification.parse()API key pairbt_payloadnone documentednone: kind + subject id + timestamp
Authorize.NetX-ANET-SignatureHMAC-SHA512, hex (often sha512= prefixed)Signature Keyraw bodynone signednotificationId
Adyen (Standard)additionalData.hmacSignature per itemHMAC-SHA256, base64HMAC key (hex-decoded)colon-joined fieldsnone signed; check livepspReference + eventCode
Mollie classicnone (unsigned id=tr_...)nonenonenonerefetch the paymentnone: idempotent worker
Mollie next-genX-Mollie-Signature (sha256=)HMAC-SHA256, hexsigning secretraw bodynone signedevent id (event_...)
TaphashstringHMAC-SHA256, hexsecret API keyx_id...x_created stringnone signedcharge id + status
PayTabsSignatureHMAC-SHA256, hexprofile Server Keyraw bodynone signedtran_ref + status
RazorpayX-Razorpay-SignatureHMAC-SHA256, hexwebhook secretraw bodynone signedx-razorpay-event-id
Squarex-square-hmacsha256-signatureHMAC-SHA256, base64subscription signature keynotification URL + raw bodynone signedevent_id
PayPalPAYPAL-TRANSMISSION-SIG (+ -ID, -TIME, CERT-URL, AUTH-ALGO)SHA256withRSA, base64; or postback to verify-webhook-signaturePayPal certificate + your webhook idtransmission id, time, webhook id, CRC32 of the raw bodytransmission time signed, no documented windowevent id
PaddlePaddle-Signature (ts=, h1=)HMAC-SHA256, hexnotification destination secretts, a colon, then the raw bodyts, default tolerance 5 sevent_id (evt_...)
Checkout.comCko-Signature (optional Authorization key)HMAC-SHA256, hexwebhook signature keyraw bodynone signedevent id (evt_...)

Where nothing signs a timestamp, a captured delivery can be replayed. The atomic dedupe on the event id, plus refetching state from the provider in the worker, is what makes a replay harmless.

Secure checkout checklist

  • PCI DSS scope. Your SAQ depends on who serves the payment fields. A full redirect to a hosted payment page usually lands in SAQ A. When your own page loads the provider's script or fields (Stripe Elements, Accept.js, Hosted Fields), your page can affect the payment page, which is typically SAQ A-EP; confirm with your acquirer, because providers classify their iframe products differently. Receiving raw card numbers on your server means SAQ D. See the PCI DSS controls mapping.
  • Hosted fields only. Collect cards with the provider's hosted page, iframe fields, or wallet SDK. A raw PAN must never reach your DaloyJS routes or logs.
  • SCA and 3-D Secure. European cards require strong customer authentication. Hosted Checkout, Adyen Drop-in, and similar flows run 3DS for you; a custom server-to-server flow must handle the challenge and redirect states.
  • Server-side amounts. Compute totals from your catalogue and verify the paid amount and currency in the webhook worker. See above.
  • Minor units and decimals. Convert at the plugin edge with one helper (src/money.ts above); 0, 2, and 3 decimal currencies all exist.
  • Webhooks are the source of truth. The browser redirect back to your site is a UX hint; mark orders paid only from a verified webhook plus a refetch.
  • Log redaction. Do not log request bodies on payment routes. Keep provider request ids, error codes, and your order id; drop names, emails, addresses, and anything card-shaped. See redaction.
  • Secrets. Separate test and live keys, rotate webhook secrets, and support two secrets during a rotation window where the provider signs with both.

Testing

  • Use each provider's sandbox: Stripe test mode and sandboxes, Braintree sandbox, Authorize.Net apitest, Adyen test accounts, Mollie test_ keys, Square sandbox, Razorpay test keys, the Tap and PayTabs test profiles, PayPal sandbox apps, Paddle sandbox accounts, and Checkout.com sandbox keys (sk_sbox_).
  • Stripe CLI: stripe listen --forward-to localhost:3000/webhooks/stripe forwards events with a local whsec_ secret, and stripe trigger checkout.session.completed fires a real test event.
  • Contract tests: sign fake webhooks with the core signWebhookPayload() and drive them through app.request(). Always include the unhappy paths: a wrong secret, a tampered body, and a duplicate delivery.
tests/webhooks.test.tsts
import test from "node:test";
import assert from "node:assert/strict";
import { signWebhookPayload } from "@daloyjs/core";
import { app } from "../src/app.ts";

const body = JSON.stringify({ event: "payment.captured", payload: {} });

test("accepts a correctly signed Razorpay webhook", async () => {
  const signature = await signWebhookPayload({ payload: body, secret: process.env.RAZORPAY_WEBHOOK_SECRET! });
  const res = await app.request("/webhooks/razorpay", {
    method: "POST",
    headers: { "content-type": "application/json", "x-razorpay-signature": signature, "x-razorpay-event-id": "evt_test_1" },
    body,
  });
  assert.equal(res.status, 200);
});

test("rejects a tampered body", async () => {
  const signature = await signWebhookPayload({ payload: body, secret: process.env.RAZORPAY_WEBHOOK_SECRET! });
  const res = await app.request("/webhooks/razorpay", {
    method: "POST",
    headers: { "content-type": "application/json", "x-razorpay-signature": signature, "x-razorpay-event-id": "evt_test_2" },
    body: body.replace("captured", "failed"),
  });
  assert.equal(res.status, 401);
});

signWebhookPayload() returns hex. For base64 providers (Shopify, Square, Adyen), convert the hex digest to base64 in the test, or sign with WebCrypto directly. Pass timestamp to reproduce Stripe-style t= signatures.

Runtime compatibility

"Node hosts" means long-lived Node, Vercel Node.js functions, AWS Lambda, and Azure Functions. Cells say "Not verified" where neither the SDK's docs nor its package metadata state support; test before you ship there. The core helpers used for verification (verifyWebhookSignature, readBodyLimited, safeJsonParse, resilientFetch) use only web-standard APIs and run on every DaloyJS adapter.

SDKNode hostsDenoCloudflare WorkersVercel Edge
stripe 23.xYes (Node 20+)Yes (npm:stripe)Yes, with createFetchHttpClient() + createSubtleCryptoProvider()Not verified
square 46.xYes (Node 18+)Yes (README: Deno 1.25+)Yes (README)Not verified
mollie-api-typescript 1.12.xYesYes (RUNTIMES.md: Deno 1.39)Not verified (Fetch-based)Not verified
@adyen/api-library 32.xYes (Node 18+)Not verifiedNot verified: call the REST API with fetchNot verified
braintree 3.xYesNot verifiedNo (Node http, Buffer): use the GraphQL APINo
authorizenet 1.xYesNot verifiedNo (Node-only dependencies): POST the JSON API with fetchNo
razorpay 2.xYesNot verifiedNot verified: call the REST API with fetchNot verified
paytabs_pt2 2.xYesNot verifiedNot verified: call the PT2 REST API with fetchNot verified
shopify-api-node 3.xYesNot verifiedNo (got, Node HTTP): call GraphQL with fetchNo
@paddle/paddle-node-sdk 3.xYes (Node 20+)Not verified (ships an edge build for the deno export condition)Not verified (edge build for worker / workerd)Not verified
checkout-sdk-node 5.xYes (Node 18+)Not verifiedNot verified (imports axios and Node stream): call the REST API with fetchNot verified
@paypal/paypal-server-sdk 2.xYes (Node 14.17+)Not verifiedNot verified (axios-based adapter): use the REST guideNot verified
Tap (no SDK, fetch)YesYesYesYes
PayPal REST (no SDK, fetch)YesYesYes (postback verification; self-verification needs node:crypto)Yes (postback verification)

DaloyJS itself requires Node ^24 || >=26, so the SDKs' own Node floors are already met on Node hosts.

Beyond one-off payments

  • Subscriptions and dunning. Let the provider own the billing schedule and retry logic (Stripe Billing, Braintree Recurring Billing, Mollie subscriptions, Adyen tokenization). Drive entitlements from webhooks and handle the failed-payment events, not from your own cron.
  • Reconciliation and disputes. Run a nightly job (see cronEnqueue) that compares provider settlement reports with your ledger, and subscribe to dispute or chargeback events so evidence deadlines are not missed.
  • Tax and merchant of record. Sales tax, VAT, and GST depend on where the buyer is. Use a tax engine (Stripe Tax and similar), or a merchant-of-record service such as Paddle that takes on the tax liability for you, rather than hard-coding rates.

Common plugin shape

Plugin lifecycle
  1. 01pluginWrap the SDKnew ProviderSDK(secrets)
  2. 02registerAttach to stateapp.decorate(name, client)
  3. 03routesCall from handlersstate.<provider>.charge()
  4. 04callbacksVerify webhooksHMAC over raw body
Every provider guide follows the same four steps, so dropping a new gateway into an existing app never touches your route code.

Each provider guide implements roughly the same interface on ctx.state:

src/plugins/commerce.tsts
export interface CommerceClient {
  // Read a product / order / customer.
  read(kind: string, id: string): Promise<unknown>;
  // Verify a webhook over the raw bytes and return the parsed event.
  verifyWebhook(headers: Headers, rawBody: Uint8Array): Promise<{ topic: string; payload: unknown }>;
}

declare module "@daloyjs/core" {
  interface AppState {
    commerce: CommerceClient;
  }
}

Provider pages keep the shape but specialise the method names where it makes the SDK nicer to read (for example, Shopify gets a graphql() passthrough so you can run typed GraphQL queries without leaving the plugin).

Edit this page on GitHub

Last updated