Pickle for Node.js
Node.js package for Pickle analytics.
Install
npm i @souranalytics/nodeSetup
import { Pickle } from '@souranalytics/node'
 
const pickle = new Pickle(options)Options
| Option | Type | Description | Required | Default | 
|---|---|---|---|---|
options.apiKey | string | Project API key | Yes | - | 
options.url | string | Override Pickle API endpoint | No | https://pickle.sh | 
options.anonymousId | string | Override anonymous user id | No | cuid2 | 
Usage
identify
pickle.identify(user: UserProps, data?: UserProps): Promise<void>| Option | Type | Description | Required | 
|---|---|---|---|
user.id | string | User id | Yes | 
user.name | string | User name | No | 
user.email | string | User email | No | 
data | object | User properties | No | 
event
pickle.event(name: string, data?: EventProps): Promise<void>| Option | Type | Description | Required | 
|---|---|---|---|
name | string | Event name | Yes | 
data | object | Event properties | No | 
view
pickle.view(name: string, data?: ViewProps): Promise<void>| Option | Type | Description | Required | 
|---|---|---|---|
name | string | View name | Yes | 
data | object | View properties | No |