Skip to content

Latest commit

 

History

History
43 lines (27 loc) · 1.72 KB

File metadata and controls

43 lines (27 loc) · 1.72 KB

A/B Testing with PostHog

PostHog is an open-source product analytics platform that offers a suite of tools, including funnels, heat maps, session recording, feature flags and more, all in a single platform.

Demo

https://edge-functions-feature-flag-posthog.vercel.sh

One-Click Deploy

Deploy the example using Vercel:

Deploy with Vercel

Getting Started

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example https://github.com/vercel/examples/tree/main/edge-functions/feature-flag-posthog feature-flag-posthog
# or
yarn create next-app --example https://github.com/vercel/examples/tree/main/edge-functions/feature-flag-posthog feature-flag-posthog

You'll need to have an account with PostHog. Once that's done, copy the .env.example file in this directory to .env.local (which will be ignored by Git):

cp .env.example .env.local

Then open .env.local and set the environment variables to match the host for your PostHog instance and the Project API key available under Project settings - Project API Key.

Next, run Next.js in development mode:

npm install
npm run dev

# or

yarn
yarn dev