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

PackagePurpose
@eden/dbDrizzle ORM schema and client
@eden/authBetter Auth configuration
@eden/aiVercel AI SDK setup
@eden/agentsInngest AgentKit networks
@eden/jobsInngest background functions
@eden/paymentsStripe integration
@eden/emailResend + React Email
@eden/storageCloudflare R2 client
@eden/analyticsPostHog setup
@eden/observabilitySentry error tracking

Key Packages

@eden/db

Exports the configured Drizzle ORM client and schema definitions.

Exports:

  • db: The authenticated Drizzle client
  • schema: 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 provider
  • streamText: AI SDK streaming helper
  • generateChatResponse: 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 client
  • functions: 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 client
  • createCheckoutSession: Helper to create payment sessions
  • constructWebhookEvent: 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 emails
  • resend: 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.