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

# Vercel Integration

> Deploy and host your InitRepo documentation on Vercel

# Vercel Integration

Deploy your InitRepo-generated documentation to Vercel for fast, reliable hosting with global CDN.

## Features

* **One-Click Deployment**: Deploy documentation directly from InitRepo
* **Automatic Updates**: Sync documentation changes automatically
* **Custom Domains**: Use your own domain for documentation
* **Analytics**: Built-in Vercel Analytics for documentation insights

## Setup

<Steps>
  <Step title="Connect Vercel Account">
    1. Visit your [InitRepo dashboard](https://www.initrepo.com)
    2. Navigate to Integrations → Vercel
    3. Click "Connect Vercel"
    4. Authorize InitRepo to deploy to your Vercel account
  </Step>

  <Step title="Create Deployment">
    Choose your deployment configuration:

    * **Project Name**: Custom subdomain or bring your own domain
    * **Build Settings**: Automatic or custom build commands
    * **Environment Variables**: Configure API keys and settings
  </Step>

  <Step title="Configure Domain">
    Set up your documentation domain:

    * Use Vercel's default subdomain
    * Connect your custom domain
    * Configure SSL certificates automatically
  </Step>
</Steps>

## Deployment Configuration

### vercel.json

```json theme={null}
{
  "name": "initrepo-docs",
  "buildCommand": "npm run build",
  "outputDirectory": "dist",
  "framework": "mintlify",
  "regions": ["iad1"],
  "functions": {
    "api/*.js": {
      "maxDuration": 30
    }
  }
}
```

### Environment Variables

Set these in your Vercel dashboard:

```bash theme={null}
INITREPO_API_KEY=your_api_key_here
ANALYTICS_ID=your_analytics_id
CUSTOM_DOMAIN=docs.yourcompany.com
```

## Automatic Deployment

Enable automatic deployment when documentation is updated:

```javascript theme={null}
// webhook endpoint for InitRepo updates
app.post('/api/deploy', async (req, res) => {
  const { projectId } = req.body;

  // Trigger Vercel deployment
  await fetch(`https://api.vercel.com/v1/integrations/deploy/${projectId}`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.VERCEL_TOKEN}`
    }
  });

  res.status(200).json({ status: 'deployed' });
});
```

## Custom Domain Setup

<Steps>
  <Step title="Add Domain">
    1. Go to your Vercel project settings
    2. Navigate to Domains
    3. Add your custom domain (e.g., docs.company.com)
  </Step>

  <Step title="Configure DNS">
    Update your DNS records:

    * **Type**: CNAME
    * **Name**: docs
    * **Value**: cname.vercel-dns.com
  </Step>

  <Step title="SSL Certificate">
    Vercel automatically provisions SSL certificates for your domain
  </Step>
</Steps>
