Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amplitude/identify

Package Overview
Dependencies
Maintainers
19
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplitude/identify

Utility functions to build and interact with the Identify API

  • 1.10.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
19
Created
Source


npm version

General

Utility functions to build and interact with the Identify API with the Node SDK. This is a builder library to help interface with creating Identify events. These events help add user properties to users and devices in your analytics, and do not count towards the event volume.

To use this, create an Identify instance and use the provided functions to set properties, chaining along function calls:

import { Identify } from '@amplitude/identify'

const identify = new Identify();
identify
  .set('start_date', 'March 3rd')
  .add('num_clicks', 4)
  .unset('needs_to_activate')

Then, this can be used with the Node SDK to send an identify call. Because identify calls are special events, there are two different ways to accomplish this:

import Amplitude from '@amplitude/node';

const client = Amplitude.init('YOUR_API_KEY');

// One way to call the identify
client.identify('USER_ID', 'DEVICE_ID', identify);
// Equivalent way to call identify
// Can also modify the identifyEvent directly here
const identifyEvent = identify.identifyUser('USER_ID', 'DEVICE_ID');
client.logEvent(identifyEvent);

Compatibility with Amplitude-Javascript

This is not compatible with the Amplitude Javascript SDK (amplitude-js). This package should not be used with that SDK, and the identify API provided there should not be used with the Node SDK. There are plans to consolidate these incompatibilities .

Group Identify

This identify supports the setGroup function. Any identify operation calls made on this object will also be treated as a group identify call. Certain operations will not be transferred to the group properties (see the docs on the Group Identify API to see which properties are supported here).

To not associate a user with the group identify, you can also use the identifyGroup function to send $groupIdentify events for a group.

Clear All

Clear all will clear all user properties from the user and device on all events going forward. Use this carefully and make sure this is something you want to do instead of creating a new user/device id. When clear all is used on the identify builder, all other operations are canceled and no new operations can be added. This is because clear all must be sent as its own identify object.

FAQs

Package last updated on 08 Sep 2022

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc