Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions experiment/browser/typescript/react-app/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_EXPERIMENT_DEPLOY_KEY=
REACT_APP_EXPERIMENT_API_KEY=
23 changes: 23 additions & 0 deletions experiment/browser/typescript/react-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
27 changes: 27 additions & 0 deletions experiment/browser/typescript/react-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Experiment Codegen with Ampli (Browser TypeScript)
An example React app using the codegenerated Experiment SDK (Xpmt). Based on create-react-app.

# Usage

### Setup the project
You will need to do the following before running the app.
1. Create a `.env` with your API keys
1. `cp .env.example .env`
2. Set your Experiment Client Deployment key
2. `yarn install`

### Run the app
You can run the app using the events from our sample experiments.
* `yarn start`

### Pull your Ampli SDK
If you want to use your own tracking plan and Ampli SDK
1. `npm i -g @amplitude/ampli`
2. `ampli exp -t <experiment-server-token> -d <experiment-deployment-name>`
3. Update `xpmt.ts` to use the latest experiments definitions from the website

# Project structure
* README.md - you are here *
* * src/
* [App.tsx](src/App.tsx) - Example user app using Xpmt SDK. A good place to start.
* [xpmt.ts](src/xpmt.ts) - Generated Experiment SDK, don't modify by hand. Update with `ampli exp`
Loading