← All platform guides

Vercel

Place the file in your public/ directory

Host app-ads.txt at your root domain

1

Place app-ads.txt in the public/ directory at the root of your project. Vercel serves all files in public/ at the root domain. This works for Next.js, Vite, Create React App, and most other frameworks Vercel supports.

2

Commit and push. Vercel will redeploy and serve the file at https://yourdomain.com/app-ads.txt.

3

Verify at https://yourdomain.com/app-ads.txt.

Note: If you are using Next.js App Router and prefer to serve the file via a route handler rather than the public/ directory, use a route handler at app/app-ads.txt/route.ts that returns a plain text Response. However, the public/ directory approach is simpler and avoids any edge function invocation.

Allow the Google-adstxt crawler in robots.txt

1

If you use Next.js App Router, the recommended approach is a robots.ts file at app/robots.ts:

import type { MetadataRoute } from 'next';

export default function robots(): MetadataRoute.Robots {
  return {
    rules: [
      { userAgent: 'Google-adstxt', allow: '/app-ads.txt' },
      { userAgent: '*', disallow: '' },
    ],
  };
}
2

For non-Next.js projects, place robots.txt in the public/ directory directly.

3

Verify at https://yourdomain.com/robots.txt.

Set up a 301 redirect (if needed)

1

Add a redirect in vercel.json:

{
  "redirects": [
    {
      "source": "/app-ads.txt",
      "destination": "https://yourdomain.com/app-ads.txt",
      "permanent": true
    }
  ]
}
2

Deploy and verify the redirect resolves to the raw file.

Done setting up?

Run a free scan to confirm your app-ads.txt is reachable and correctly configured.

Run a free scan

Using a different platform? Browse all platform guides

Vercel: app-ads.txt setup guide — AppAds Verify