This repository contains the source code for the 'Books' app in the article: Implementing A/B testing in a Next.js app with ConfigCat & Amplitude. Read the blog post here
Books app with A and B versions
If a user clicks the 'Download PDF' button, the app sends data to Amplitude so we know the number of users that clicked the button for each version.
If you want to run the app on your development machine, you'll need to have Git and Node.js installed.
Follow these steps to get the app running on your machine:
- Click on the green "Code" button in the repository's page and copy the URL in the text field that pops up.
- Open the command line terminal on your computer.
- Run
git clone https://github.com/configcat-labs/ab-testing-nextJS-amplitude-sample.git
. - Navigate into the folder 'ab-testing-nextJS-amplitude-sample'.
- Install the dependencies.
npm install
- Run
npm run dev
.
The app should now be running on localhost:3000. Open up localhost:3000 in your browser to view the app.
Here are some helpful resources for further learning:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
- Amplitude JavaScript Documentation - learn how to use Amplitude with JavaScript
- Amplitude Event Segmentation Charts - learn about Event Segmentation Charts in Amplitude
ConfigCat also supports many other frameworks and languages. Check out the full list of supported SDKs here
You can also explore other code samples for various languages, frameworks, and topics here in the ConfigCat labs on GitHub.
Keep up with ConfigCat on Twitter, Facebook, LinkedIn, and GitHub.
Contributions are welcome!