Skip to content
Meet Garden. Finance starts with a conversation.Take a look
GardenKit / @l1fe/garden

One integration. A whole billing workspace.

Checkout, customer portals, metering, invoices and webhooks. A typed TypeScript surface for the billing work behind your product.

The surface

Small calls. Useful connections.

garden.checkout.create(...)

Hosted or embedded checkout sessions.

garden.portal.link(...)

A link to the customer's billing portal.

garden.usage.ingest(...)

Usage events with idempotency keys.

garden.meter.ingest(...)

The same usage ingestion surface.

garden.meters.listForCustomer(...)

Read customer usage and meters.

garden.invoices.list(...)

Customer invoice records.

garden.paymentMethods.list(...)

Account-scoped payment methods.

garden.addresses.upsert(...)

Customer billing addresses.

garden.webhooks.verify(...)

Verify a raw event body and headers.

garden.webhooks.route(...)

Build a request handler for billing events.

Start with context

The account comes with the call.

Configure the server-side client with an authorized account and the endpoint for your deployment. Use stable event identities when metering the same business event across retries.

TypeScript / server-side usage example
// Server-side example. Use your configured endpoint and tenant context.
import { createGarden } from "@l1fe/garden";

const garden = createGarden({
  baseUrl: process.env.GARDEN_API_URL!,
  apiKey: process.env.GARDEN_API_KEY!,
  platformId: "your-platform",
  organizationId: authorizedOrganizationId,
});

await garden.usage.ingest("your-platform.task.completed", {
  quantity: 1,
  metadata: { projectId: "project_123" },
}, { idempotencyKey: "task_123_completed" });

const invoices = await garden.invoices.list();
Keep the connection clear

Know what arrived. Verify where it came from.

GardenKit accepts the raw webhook body and request headers for verification. Configure the current webhook secret for the integration.

TypeScript / verification example
// Server-side example. Configure a durable idempotencyStore
// appropriate to your deployment when routing production events.
const garden = createGarden({
  baseUrl: process.env.GARDEN_API_URL!,
  webhookSecret: process.env.GARDEN_WEBHOOK_SECRET!,
});

// Verify directly when writing your own request handler:
const rawBody = await request.text();
const event = await garden.webhooks.verify(
  rawBody,
  request.headers,
);
Add GardenKit

Use your configured package registry.

The package is named @l1fe/garden. Configure access to your organization's registry before installing, and use the framework entrypoint appropriate to your application.

@l1fe/garden/next@l1fe/garden/hono@l1fe/garden/express@l1fe/garden/keystone@l1fe/garden/planter
Good questions.

A little integration clarity.

Does GardenKit replace Keystone?

No. New L1fe applications use Keystone as the platform contract for identity, access and billing. GardenKit is the billing SDK and provides an adapter at @l1fe/garden/keystone.

Can I use GardenKit in a browser?

Keep privileged API credentials and account authorization on the server. Use the appropriate server integration and the Planter components for the customer-facing billing interface.

Are these snippets complete applications?

No. They illustrate the current SDK method signatures. Configure your endpoint, authorized account context, error handling and deployment-specific event handling before integrating them.

Bring the billing work into your product.