0.0.2 • Published 3 years ago
@souranalytics/js
Official Pickle library for JavaScript.
Quickstart
Install
Yarn
yarn add @souranalytics/js
NPM
npm install @souranalytics/js
Basic usage
import { Pickle } from '@souranalytics/js'
const pickle = new Pickle('YOUR_API_KEY')
await pickle.identify('101', {
planet: 'Earth'
})
await pickle.event('sign_in', {
source: 'web'
})
await pickle.view('Sign in', {
source: 'web'
})
Docs
Init
const pickle = new Pickle('YOUR_API_KEY')
Parameter | Type | Required | Description |
---|
key | string | Yes | Pickle app key |
Identifying users
pickle.identify(id, data?, meta?)
Parameter | Default value | Type | Required | Description |
---|
id | - | string | Yes | User id |
data | {} | Json | No | Properties |
meta | {} | Json | No | Meta |
Sending events
pickle.event(name, data?, meta?)
Parameter | Default value | Type | Required | Description |
---|
name | - | string | Yes | Event name |
data | {} | Json | No | Properties |
meta | {} | Json | No | Meta |
Recording views
pickle.view(name, data?, meta?)
Parameter | Default value | Type | Required | Description |
---|
name | - | string | Yes | View name |
data | {} | Json | No | Properties |
meta | {} | Json | No | Meta |
Changelog
0.0.1