I am a product log maker, so I write logs day by day.

Downloads in past


1.0.1a year agoa year agoMinified + gzip package size for mixgather in KB


NPM NPM GitHub Workflow Status
"I am a product log maker, so I write logs day by day."


$ yarn add mixgather


  1. Init - Required

import mixgather from 'mixgather'

async inSomeSetupHook() {
  // ...other setup
  await mixgather.init({
    debug: process.env.NODE_ENV !== 'production',
    google: {
      id: 'G-XXXX'
    mixpanel: {
      token: 'xxxxxx'
  // ...integrate track with router hooks

The init step is async, we should track after finishing it.

  1. Track - Core

// Pages
mixgather.page('/profile', 'User Home')

// Events
mixgather.event('el_clicked', {
  property: 'value'

// Screens

  1. User - Optional

Set the userMeta on the gathers:
mixgather.setUser({ id: 'xxxxx', ...otherProps })

if id is null, will remove the current user.

  1. Global Property - Optional

mixgather.setProperty({ appName: 'xxxxx', ...others })

if property value is null, will remove the property.

Get Vendors

Sometimes, we need to run vendor-spec APIs, getting $vendor sdk is necessary.
const gatherName = 'mixpanel' // 'google'


Run Example in Local

$ yarn dev

It starts a server at http://localhost:1234.

Reset Package Name

  1. git clone git@github.com:rct-ai/mixgather.git
  2. cd mixgather
  3. yarn
  4. yarn setup

Node.js, npm and/or yarn version

The lib relies on volta to ensure node version to be consistent across developers. It's also used in the GitHub workflow file.


Leverages esbuild for blazing fast builds, but keeps tsc to generate .d.ts files. Generates two builds to support both ESM and CJS.
  • build: runs typechecking then generates CJS, ESM and d.ts files in the build/ directory
  • clean: removes the build/ directory
  • type:dts: only generates d.ts
  • type:check: only run typechecking
  • type:build: only generates CJS and ESM


Mixgather uses ava and esbuild-register so that there is no need to compile before the tests start running. The coverage is done through nyc.
  • test: runs ava test runner
  • test:coverage: runs ava test runner and generates coverage reports

Format & lint

This template relies on the combination of eslint — through typescript-eslint for linting and prettier for formatting. It also uses cspell to ensure spelling
  • format: runs prettier with automatic fixing
  • format:check: runs prettier without automatic fixing (used in CI)
  • lint: runs eslint with automatic fixing
  • lint:check: runs eslint without automatic fixing (used in CI)
  • spell:check: runs spellchecking


Under the hood, this library uses semantic-release and commitizen. The goal is to avoid manual release process. Using semantic-release will automatically create a github release (hence tags) as well as an npm release. Based on your commit history, semantic-release will automatically create a patch, feature or breaking release.
  • cz: interactive CLI that helps you generate a proper git commit message, using commitizen
  • semantic-release: triggers a release (used in CI)