1.0.21 • Published 2 years ago

@inleads/event-logger v1.0.21

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

InLeads

Event Logger SDK for InLeads. The Smart Sales Management System.

Getting Started

Installation

NPM

npm install @inleads/event-logger --save

Yarn

yarn add @inleads/event-logger

Script

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@inleads/event-logger/dist/events.js"></script>

Basic Usage

Node.js

const InLeads = require('@inleads/event-logger')
// The only required field is the api token
InLeads.init('api-token');

// Should be called once to initialise user, email is Mandatory
InLeads.setUser('email', 'name', { role: 'some-role' });

// track should only be called once init and setUser is completed
// event-name is mandatory
InLeads.track('event-name', { from: 'screen-name' });

ES6 module

import { init, track, setUser } from '@inleads/event-logger'
// The only required field is the api token
init('api-token');

// Should be called once to initialise user, email is Mandatory
setUser('email', 'name', { role: 'some-role' });

// track should only be called once init and setUser is completed
// event-name is mandatory
track('event-name', { from: 'screen-name' });

General JavaScript (script tag)

// The only required field is the api token
inleadsEvents.init('api-token');

// Should be called once to initialise user, email is Mandatory
inleadsEvents.setUser('email', 'name', { role: 'some-role' });

// track should only be called once init and setUser is completed
// event-name is mandatory
inleadsEvents.track('event-name', { from: 'screen-name' });

Functions Reference

init

  init('api-token')
ParameterTypeDescription
api-tokenstringRequired. Your API key

setUser

  setUser('email', 'name', {role: "userRole"})
ParameterTypeDescription
emailstringRequired. Email Id of the contact / user
namestringOptional. Name of the contact / user
optionsobjectOptional. JSON object can have any meta data to save with user data

track

  track('event-name', {from: "screenName"})
ParameterTypeDescription
event-namestringRequired. Name for the event can be any string
optionsobjectOptional. JSON object can have any meta data to save with event data

unset

  unset()

No parameters required

1.0.19

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago