tracie
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

Tracie (client)

Current version Install size

Tracie is a self-hosted event tracking service written in NodeJS. This is a client library, used to create events and send them to your hosted server. Supported on either NodeJS and browser enviroment.

Note: Usage on NodeJS and browser is slightly different_


Install and Usage on Browser

On browser, embed the tracie distribution script, and use

1. Embed distribution script

// Add tracie client
<script src="path/dist/index.min.js" />

// Or using jsdelivr (you can replace `latest` with a version)
<script src="https://cdn.jsdelivr.net/npm/tracie@latest/dist/index.min.js" />

2. Usage

// Initate connection
tc.initiate({ server: "{serverpath}" });

// send event
tc("event_name");

document.onload = function() {
    tc("hits")
}

Install and Usage on Webpack (es5, es6, ...)

You'll need to install tracie and node-fetch

1. Install

# using yarn
$ yarn add tracie node-fetch

# using npm
$ npm install tracie node-fetch --save

2. Usage

// Import using require
const Tracie = require("tracie");

// Or import in ES6
import Tracie from "tracie";

const tc = new Tracie({
    server: "{serverpath}"
})

// Add an event
tc.add("event_name");

Readme

Keywords

Package Sidebar

Install

npm i tracie

Weekly Downloads

3

Version

0.0.5

License

MIT

Unpacked Size

6.72 kB

Total Files

10

Last publish

Collaborators

  • hieunc