Vercel Marketplace integration
Contents
The Vercel Marketplace integration adds PostHog to your Vercel projects. There are two ways to set it up:
- Add – Creates a new PostHog organization with billing through Vercel
- Link Existing Account – Connects an existing PostHog organization. Billing stays with PostHog.
New accounts created through the Add flow are billed through Vercel. Linked accounts keep their existing PostHog billing. You cannot migrate an existing PostHog organization to Vercel billing.
Installing the integration
Add (new account)
- Go to the PostHog integration page on Vercel Marketplace
- Click Add
This creates a new PostHog organization and project, and adds environment variables to your Vercel project. Billing goes through your Vercel account.
Link Existing Account
If you already have a PostHog account, you can connect it to Vercel instead:
- Go to the PostHog integration page on Vercel Marketplace
- Click Link Existing Account
- Log in to your PostHog account if prompted
- Select the organization you want to link
- Click Connect organization
You must have admin or owner access to the PostHog organization to link it. Billing stays with PostHog for linked accounts.
Environment variables
The integration adds these environment variables to your Vercel project:
NEXT_PUBLIC_POSTHOG_KEY- Your project API key, used to initialize the PostHog SDKNEXT_PUBLIC_POSTHOG_HOST- The PostHog API host URL (eitherhttps://us.i.posthog.comorhttps://eu.i.posthog.com)
These NEXT_PUBLIC_* variable names work automatically in Next.js for both client and server environments. For other frameworks, you may need to copy the values to framework-specific variable names:
| Framework | Rename to |
|---|---|
| Next.js | NEXT_PUBLIC_POSTHOG_TOKEN, NEXT_PUBLIC_POSTHOG_HOST |
| Vite/SvelteKit | VITE_POSTHOG_TOKEN, VITE_POSTHOG_HOST |
| Nuxt | NUXT_PUBLIC_POSTHOG_TOKEN, NUXT_PUBLIC_POSTHOG_HOST |
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 depends on how you installed the integration:
- Add (new account) – Billed through your Vercel account. View usage in Vercel under Integrations → PostHog.
- Link Existing Account – Billed through your existing PostHog account. View usage in PostHog billing settings.
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