garden.checkout.create(...)Hosted or embedded checkout sessions.
Checkout, customer portals, metering, invoices and webhooks. A typed TypeScript surface for the billing work behind your product.
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.
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.
// 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();GardenKit accepts the raw webhook body and request headers for verification. Configure the current webhook secret for the integration.
// 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,
);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/planterNo. 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.
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.
No. They illustrate the current SDK method signatures. Configure your endpoint, authorized account context, error handling and deployment-specific event handling before integrating them.