Packages
Overview of shared packages in the monorepo
This guide provides an overview of the shared packages located in the packages/ directory. These packages are used across the applications (web, api, mobile) to ensure code sharing and type safety.
Package List
| Package | Purpose |
|---|---|
@eden/db | Drizzle ORM schema and client |
@eden/auth | Better Auth configuration |
@eden/ai | Vercel AI SDK setup |
@eden/agents | Inngest AgentKit networks |
@eden/jobs | Inngest background functions |
@eden/payments | Stripe integration |
@eden/email | Resend + React Email |
@eden/storage | Cloudflare R2 client |
@eden/analytics | PostHog setup |
@eden/observability | Sentry error tracking |
Key Packages
@eden/db
Exports the configured Drizzle ORM client and schema definitions.
Exports:
db: The authenticated Drizzle clientschema: All database schema definitions
Usage:
import { db, users } from "@eden/db";
import { eq } from "drizzle-orm";
const user = await db.query.users.findFirst({
where: eq(users.id, "user_123")
});@eden/auth
Configures Better Auth with Drizzle adapter and plugins.
Exports:
auth: The Better Auth instance
Usage:
import { auth } from "@eden/auth";
const session = await auth.api.getSession({
headers: request.headers
});@eden/ai
Sets up Vercel AI SDK with default models and helper functions.
Exports:
openai: Configured providerstreamText: AI SDK streaming helpergenerateChatResponse: Helper for chat completions
Usage:
import { generateChatResponse } from "@eden/ai";
const result = await generateChatResponse([
{ role: "user", content: "Hello!" }
]);For more details, see the AI Features Guide.
@eden/jobs
Exports the Inngest client and background function definitions.
Exports:
inngest: The Inngest clientfunctions: Array of all background functions
Usage:
import { inngest } from "@eden/jobs";
await inngest.send({
name: "app/user.created",
data: { userId: "123" }
});For more details, see the Background Jobs Guide.
@eden/payments
Handles Stripe integration for subscriptions and one-time payments.
Exports:
stripe: Authenticated Stripe clientcreateCheckoutSession: Helper to create payment sessionsconstructWebhookEvent: Helper to verify webhooks
Usage:
import { createCheckoutSession } from "@eden/payments";
const session = await createCheckoutSession({
priceId: "price_123",
customerEmail: "user@example.com",
successUrl: "https://example.com/success",
cancelUrl: "https://example.com/cancel"
});For more details, see the Stripe Payments Guide.
@eden/email
Combines Resend for delivery with React Email for templates.
Exports:
sendEmail: Helper function to send emailsresend: Raw Resend client- Templates from
emails/directory
Usage:
import { sendEmail } from "@eden/email";
import { WelcomeEmail } from "@eden/email/templates";
await sendEmail({
to: "user@example.com",
subject: "Welcome!",
template: <WelcomeEmail name="User" />
});Full documentation for Eden Stack users
This documentation is exclusively available to Eden Stack customers. Already purchased? Log in to access the full content.