Please see the main PostHog docs.
Specifically, the JS integration details.
Unit tests: run yarn test
Cypress: yarn cypress
Testing on IE11 requires a bit more setup.
- Run
posthog
locally on port 8000 - Run
python manage.py setup_dev --no-data
on posthog repo, which sets up a demo account - Optional: rebuild array.js on changes:
nodemon -w src/ --exec bash -c "yarn build-array"
- Export browserstack credentials:
export BROWSERSTACK_USERNAME=xxx BROWSERSTACK_ACCESS_KEY=xxx
- Run tests:
npx testcafe "browserstack:ie" testcafe/e2e.spec.js
Update dependency in package.json to e.g. "posthog-js": "link:../posthog-js"
, yarn
and run yarn build && yarn build-module
To release a new version, make sure you're logged in to NPM (npm login
)
We tend to follow the following steps:
- Merge your changes into master
- Release changes as a beta version
npm version 1.x.x-beta.0
npm publish --tag beta
git push --tags
- Create a PR linking to this version in the main repo
- Once deployed and tested, write up CHANGELOG.md, and commit.
- Release a new version
npm version 1.x.x
npm publish
git push --tags
- Create a PR linking to this version in the main repo