Skip to main content
Experimental API - Context Connectors is experimental and subject to breaking changes.

Prerequisites

  • A Vercel account (or Express server)
  • Augment API credentials
  • AWS credentials + S3 bucket
  • A GitHub repo you control

Steps

1. Create a Vercel project

npx create-next-app@latest my-webhook --typescript --app
cd my-webhook
npm install @augmentcode/context-connectors @aws-sdk/client-s3

2. Create the webhook handler

Create app/api/webhook/route.ts:
import { createVercelHandler } from "@augmentcode/context-connectors/integrations/vercel";
import { S3Store } from "@augmentcode/context-connectors/stores";

const store = new S3Store({ bucket: process.env.INDEX_BUCKET! });

export const POST = createVercelHandler({
  store,
  secret: process.env.GITHUB_WEBHOOK_SECRET!,
  shouldIndex: (event) => event.ref === "refs/heads/main",
});

3. Set environment variables in Vercel

AUGMENT_API_TOKEN=your-token
AUGMENT_API_URL=https://your-tenant.api.augmentcode.com/
GITHUB_WEBHOOK_SECRET=your-secret
INDEX_BUCKET=my-indexes
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret

4. Deploy

npx vercel --prod
Note the URL (e.g., https://my-webhook.vercel.app).

5. Configure GitHub webhook

  1. Go to your repo → Settings → Webhooks → Add webhook
  2. Payload URL: https://my-webhook.vercel.app/api/webhook
  3. Content type: application/json
  4. Secret: same as GITHUB_WEBHOOK_SECRET
  5. Events: Just the push event
  6. Click “Add webhook”

6. Test it

Push a commit to main. Check Vercel logs for:
Indexed myorg/myrepo: 142 files indexed

Done!

Your index updates automatically on every push to main.

Also Works With

Instead of…Try…
VercelExpress: createExpressHandler() from integrations/express
VercelAny framework: createGitHubWebhookHandler() + verifyWebhookSignature()
Main branch onlyCustomize shouldIndex to match any branch pattern
S3 storageFilesystemStore for local/self-hosted setups