Early Access: Concepts and architecture are stable; some API names and module boundaries may evolve.
Credit SDK by Aarthik Labs

Multi-Tenancy

Learn about multi-tenancy in your app.

const tenantCredit = credit.withTenant("tenant_123");

// All calls from this instance are tenant-scoped automatically
await tenantCredit.request("/some/path");

Per-request override (useful for edge cases)

await credit.request("/some/path", {
  tenantID: "tenant_override",
});

Dynamic tenant resolution (if tenant is in app state)

const credit = createCreditClient({
  baseURL: "https://YOUR_BASE_URL",
  tenant: {
    resolveTenantID: async () =>
      window.sessionStorage.getItem("tenant_id") ?? undefined,
  },
});

On this page