Socket
Book a DemoInstallSign in
Socket

@attraqt/activity

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@attraqt/activity

## Installation and Usage

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
832
7.08%
Maintainers
1
Weekly downloads
 
Created
Source

@attraqt/activity

Installation and Usage

npm install --save @attraqt/activity
import {activity} from @attraqt/activity

activity.init({
  trackerKey: "YOUR_TRACKER_KEY",
  region: "WEBSITE_REGION"  // optional, set to EU by default
});

activity.setUser({
  identities: {
    sessionid: "YOUR_SESSION_ID"
  },
  traits: {
    birthday: "2020-04-01"
  },
  segments: ["segment1"]
});

activity.send({
  action: "view",
  target: {
    product: "YOUR_PRODUCT_ID"
  }
});

Methods

MethodArgument(s)ResultDescription
initoptions: ActivityInitOptionsvoidInitializes the activity client
sendactivity: Activity | Activity[], options?: SendActivityOptionsPromise<Response>Sends the activity
setUseruser: UservoidSets the user to be sent along with future activities
clearUservoidClears the previously set user
addUserIdentityidentityRepository: string, identity: stringvoidSets a user identity
setUserIdentitiesidentities: {[identityRepository: string]: string}voidSets user identities
addUserSegmentsegment: stringvoidAdds a segment to the user
setUserSegmentssegments: string[]voidSets user segments
addUserTraittrait: string, traitValue: stringvoidAdds a trait to the user
setUserTraitstraits: {[trait: string]: string}voidSets user traits
getUserClustersPromise<Clusters>get the user clusters

FAQs

Package last updated on 09 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.