Giter Club home page Giter Club logo

posthog-js-lite's Introduction

posthog-js-lite

The next generation of PostHog client libraries within the JS/TS ecosystem.

The lofty goals of this codebase is to solve the core client logic of our various JS based libraries in one place (web, node, React Native).

The short-term goal is to have a dedicated React Native library free from any platform-specific installations (the previous client library is a wrapper for the posthog-ios and posthog-android libraries). This enables a few things:

  1. Installation to Expo managed projects without any separate compilation / ejecting
  2. Tighter integration to RN enabling hooks, context, autocapture etc.

Changelog

Find the changelogs for the respective libraries in their folders:

  1. posthog-node
  2. posthog-react-native
  3. posthog-web

Development

This repository is broken into different packages

  • /posthog-core > All common code goes here.
  • /posthog-node > Node.js specific code
  • /posthog-react-native > React Native specific code
  • /posthog-web > Web (DOM) specific code

Running tests

yarn test
# Run the RN tests - these are separate due to specific babel configs
yarn test:rn

Running E2E tests with Detox

See Example Expo Readme

Examples

React Native

cd examples/example-expo
yarn && yarn start

Node.js

First install yalc:

yarn global add yalc

Then run:

cd examples/example-node
yarn && yarn start
# example-expo has some buttons that will talk to this server

Publishing a new version

  1. Go to the appropriate package.json file. For example, for posthog-node, this is posthog-node/package.json.
  2. Bump the version number in the file.
  3. Add to CHANGELOG.md the relevant changes.
  4. On merge, a new version is published automatically thanks to the CI pipeline.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.