SDK quickstart
Published release: SDK 0.1.3 is publicly available on npm. Package installation does not activate new backend features.
- Open Settings → API Keys in an approved store and select TEST. Store the TEST key in backend configuration.
- Supply
baseUrlas the actual API origin only,storeId,apiKeyandenvironment: 'TEST'tomakeClientbelow. The example does not contact any service merely by being imported. - Call
client.products.list()to locate an approved product UUID. UsecreateTestCheckout(client, productId)for the isolated TEST link. Individual TEST requires the sale market; this example uses AU as a test context, not proof of LIVE approval. - Validate the returned URL against your configured checkout origin before handing it to the browser.
- Use TEST credentials and fictitious test data only. A TEST result creates no LIVE bank payout or LIVE fulfillment entitlement.
For an approved LIVE integration, use checkout.createHosted and then server-side confirmation. Do not change only the environment label: use the matching LIVE key and independently verified account/product/market setup.
Server-only TEST example from the public npm package
Section titled “Server-only TEST example from the public npm package”Install @kordiva/[email protected] with pnpm add @kordiva/[email protected]. Run this example only from a protected Node backend using your own TEST Store API key and approved product ID:
The tested TypeScript example below exports makeClient(config) and createTestCheckout(client, productId). Call client.products.list({ limit: 20 }) first to read approved catalog items, then use the documented TEST method client.checkout.createTest({ productId, testSaleMarket: 'AU' }) with the chosen approved product. The shared example selects AU as its TEST scenario; do not change it to US unless that market is supported and approved for your TEST store. Keep the returned link private; neither market represents LIVE approval.
products.list reads the catalog; createTest creates an isolated TEST checkout link. It does not enable LIVE sales or payouts. Never publish Store API keys or checkout token URLs. In LIVE, the separately approved backend uses checkout.createHosted and payments.confirm, never a TEST key.
import { Kordiva } from "@kordiva/sdk";import type { KordivaOptions } from "@kordiva/sdk";/** Configuration comes from protected backend configuration, never NEXT_PUBLIC_* or VITE_*. */export function makeClient(config: KordivaOptions): Kordiva { return new Kordiva(config);}export async function createTestCheckout(client: Kordiva, productId: string) { return client.checkout.createTest({ productId, testSaleMarket: "AU" });}Related guides
Section titled “Related guides”SDK · Checkout · Security · API
Business integration
Section titled “Business integration”Recurring checkout and subscription reads → Signed Business events → Raw-body verification → Business refunds → API reference. Individual MoR follows its separate refund process.