Vercel Marketplace integration
Contents
The Vercel Marketplace integration adds PostHog feature flags and experiments to your Vercel projects with billing handled through Vercel.
Choose this integration if you do not already have a PostHog account and you prefer to consolidate payment for PostHog inside your Vercel invoice.
This integration creates a new PostHog organization. You cannot migrate an existing PostHog organization to be billed through Vercel.
Installing the integration
- Go to the PostHog integration page on Vercel Marketplace
- Click Install
This creates a PostHog organization and project, and adds environment variables to your Vercel project.
Environment variables
The integration adds these environment variables to your Vercel project:
POSTHOG_PROJECT_API_KEY- Your project API key, used to initialize the PostHog SDKPOSTHOG_HOST- The PostHog API host URL (eitherhttps://us.i.posthog.comorhttps://eu.i.posthog.com)
For client-side frameworks, you'll need to rename these variables in your Vercel project settings to expose them to the browser:
| Framework | Rename to |
|---|---|
| Next.js | NEXT_PUBLIC_POSTHOG_KEY, NEXT_PUBLIC_POSTHOG_HOST |
| Vite/SvelteKit | VITE_POSTHOG_KEY, VITE_POSTHOG_HOST |
| Nuxt | NUXT_PUBLIC_POSTHOG_KEY, NUXT_PUBLIC_POSTHOG_HOST |
Server-side code can use the original names directly.
Installing the SDK
The fastest way to add PostHog to your application is using our installation wizard. Alternatively, follow your framework's guide:
By default, you'll also get session replay and event autocapture. If you prefer to use feature flags only, you can opt out:
Using feature flags
To use feature flags in your application:
For more examples, see our feature flag code guide.
Creating feature flags and experiments
Access the PostHog dashboard from your Vercel project's Integrations tab or directly at app.posthog.com.
Feature flags and experiments you create automatically sync with Vercel's flags dashboard.
For full documentation:
Billing
Billing goes through your Vercel account. View usage in Vercel under Integrations → PostHog.
See our pricing page for more details.
Limitations
- One organization per Vercel team - Cannot link multiple PostHog organizations
- Cloud only - No self-hosted support (US or EU regions available)
- Region cannot be changed - US or EU is selected during installation
- One-way team sync - Vercel team changes sync to PostHog, not vice versa