> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anotherwrapper.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment

> Take your app live on Vercel in minutes

You've built something cool locally. Now let's get it in front of real users. This guide walks you through deploying to Vercel -- the recommended (and easiest) target for this repo.

## Before You Deploy

Make sure you've checked off these prerequisites:

<Check>Your app runs and works locally</Check>
<Check>Better Auth env vars are configured</Check>
<Check>Drizzle migrations have been applied to your production database</Check>
<Check>You know your production domain</Check>
<Check>You have your env vars ready to paste into Vercel</Check>

## Deploy to Vercel

<Steps>
  <Step title="Push your repo to GitHub">
    If you haven't already, push your code to a GitHub repository. Vercel connects directly to GitHub for automatic deployments.
  </Step>

  <Step title="Import into Vercel">
    Head to [vercel.com](https://vercel.com), click **Add New Project**, and import your GitHub repo. Vercel will auto-detect that it's a Next.js app.
  </Step>

  <Step title="Configure build settings">
    Use these defaults:

    | Setting         | Value          |
    | --------------- | -------------- |
    | Install command | `pnpm install` |
    | Build command   | `pnpm build`   |
    | Start command   | `pnpm start`   |
  </Step>

  <Step title="Add your production env vars">
    At minimum, you need these:

    ```env theme={null}
    NEXT_PUBLIC_APP_URL=https://yourdomain.com
    BETTER_AUTH_SECRET=...
    DATABASE_URL=postgresql://...
    ```

    Plus at least one LLM provider key:

    <CodeGroup>
      ```env OpenAI theme={null}
      OPENAI_API_KEY=...
      ```

      ```env Google AI theme={null}
      GOOGLE_GENERATIVE_AI_API_KEY=...
      ```

      ```env Anthropic theme={null}
      ANTHROPIC_API_KEY=...
      ```
    </CodeGroup>

    <Warning>
      `DATABASE_URL` should point to your **production** PostgreSQL connection string. Keep it server-side only -- never use a `NEXT_PUBLIC_` prefix for it.
    </Warning>
  </Step>

  <Step title="Hit Deploy">
    Click deploy and watch your app go live. Vercel will build and deploy it automatically.
  </Step>
</Steps>

## After Deployment

Once your app is live, come back and update these settings to use your production domain:

<Steps>
  <Step title="Update auth-related URLs">
    * Set `NEXT_PUBLIC_APP_URL` to your live domain (if not already)
    * Update `BETTER_AUTH_URL` if you use the override
    * Update your Google OAuth redirect URIs to `https://yourdomain.com/api/auth/callback/google`
    * Update auth email sender/domain settings in your email provider
  </Step>

  <Step title="Update payment and webhook URLs">
    Point your payment webhook URLs to your live domain. Each payment provider (Polar, Stripe, LemonSqueezy) has its own webhook settings -- update them to use your production URL.
  </Step>

  <Step title="Update any other provider callback URLs">
    If you use any other services with callback URLs or allowlists, make sure they know about your new domain.
  </Step>
</Steps>

## Optional Env Vars

You only need to add env vars for the features you actually use. Here are the common extras:

<Tabs>
  <Tab title="Auth Emails">
    ```env theme={null}
    EMAIL_PROVIDER=...
    AUTH_EMAIL_FROM=...
    AUTH_EMAIL_REPLY_TO=...
    ```
  </Tab>

  <Tab title="Google OAuth">
    ```env theme={null}
    GOOGLE_CLIENT_ID=...
    GOOGLE_CLIENT_SECRET=...
    NEXT_PUBLIC_GOOGLE_AUTH_ENABLED=true
    ```
  </Tab>

  <Tab title="Other Services">
    Add keys only for what you need:

    * Storage provider credentials
    * Payment provider keys and webhook secrets
    * Analytics (PostHog, Plausible, DataFast)
    * Sentry DSN for error tracking
    * Replicate, ElevenLabs, and other AI provider keys
  </Tab>
</Tabs>

<Info>
  OpenAI is still required if you want PDF RAG embeddings or GPT Image, even if you use a different LLM provider for chat.
</Info>

## Post-Deploy Verification

Run through this checklist to make sure everything is healthy:

<Check>The live landing page loads</Check>
<Check>Auth works on the live domain (sign up, sign in)</Check>
<Check>`/` loads after sign-in</Check>
<Check>Your main enabled feature works in production</Check>

## Mintlify Docs

<Tip>
  If you connect Mintlify to this repo, point the docs root to `docs/public`. Your docs will auto-deploy alongside your app.
</Tip>
