Frontend SDKsJavaScript
Installation
Install @easylabs/browser and verify your setup.
Prerequisites
- A modern evergreen browser (the SDK uses
fetch,URL, andpostMessage; no polyfills bundled). - A bundler that understands ES modules — Vite, Rollup, esbuild, webpack 5, or Parcel all work. The package is published as ESM with a CJS fallback.
- Node 22+ if you build the project locally (the package's
enginesfield declares>=22). - An Easy Labs API key. Sandbox keys are prefixed
sk_test_; production keys are not. Get one from the Easy Labs dashboard.
Install the package
npm install @easylabs/browserpnpm add @easylabs/browseryarn add @easylabs/browserbun add @easylabs/browserVerify the install
import { createEasyClient } from "@easylabs/browser";
const easy = await createEasyClient({ apiKey: "sk_test_..." });
// If the key is invalid, createEasyClient rejects before you reach this line.
const customers = await easy.getCustomers({ limit: 1 });
console.log(customers);createEasyClient calls GET /validate-key against the Easy Labs API as part of construction, so a successful resolution is itself proof that the key, the network path, and the SDK are all wired up correctly.
Next steps
- Quickstart — render your first payment.
- Client — the SDK's entry point.