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

deepin-js-sdk

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deepin-js-sdk

javascript SDK to use deepin platform

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-87.5%
Maintainers
1
Weekly downloads
 
Created
Source

Deepin SDK

MIT License NPM version

How to

How to use Deepin SDK

In Nodejs

  yarn add deepin-js-sdk
  const deepIn = require('deepin-js-sdk')
  ...

exmaple

In Es6

  yarn add deepin-js-sdk
  import deepIn from 'deepin-js-sdk'
  ...

exmaple

In Es5

Copy the following line in the index.html

  <script src="https://stage-web.mydeepin.ir/download/standalone.js"></script>
  <script>
    const deepIn = window.Deepin
    ...
  </script>

example

Api

Init

Use the init method to initialize the deepIn SDK.

deepIn.init(writeKey, [configurations]);
writeKey

the given writekey for the source you have created in deepin panel.

Identify

Use the identify method to link your users and their actions, to a recognizable userId and traits.

deepIn.identify(userId, [traits]]);
userId

The database ID for the user. If you don’t know who the user is yet, you can set the userId an empty string and just record traits.

traits

A dictionary of traits you know about the user, you can read more about traits in the identify traits type

deepIn.identify('12091906-01011992', {
  traits_firstName: 'Grace',
  traits_lastName: 'Hopper'
});

Track

The Track method lets you record actions your users perform.

deepIn.track(event, [properties]);
event

The name of the event you’re tracking.

properties

A dictionary of properties for the event. If the event was 'Added to Cart', it might have properties like price and productType. you can read more about properties in the track properties type

Page

The Page method lets you record page views on your website, along with optional extra information about the page viewed by the user.

deepIn.page([category], [properties]);
category

The category of the page. Useful for cases like ecommerce where many pages might live under a single category.

properties

A dictionary of properties of the page. you can read more about properties in the page properties type

deepIn.page('Pricing');
deepIn.page('Pricing', {
  page_title: 'Segment Pricing',
  page_url: 'https://segment.com/pricing',
  page_referrer: 'https://segment.com/warehouses'
});

Group

The Group method associates an identified user with a company, organization, project, workspace, team, tribe, platoon, assemblage, cluster, troop, gang, party, society or any other collective noun you come up with for the same concept.

deepIn.group(groupId, [traits]);
groupId

The Group ID to associate with the current user.

traits

A dictionary of traits for the group. Example traits for a group include address, website, and employees. you can read more about traits in the track traits type

deepIn.group('UNIVAC Working Group', {
  traits_employees: 'Eckert–Mauchly',
  traits_industry: 'IT',
});

Alias

The Alias method combines two unassociated user identities. Segment usually handles aliasing automatically when you call identify on a user, however some tools require an explicit alias call.

deepIn.alias(userId, [previousId]);
userId

The new user ID you want to associate with the user.

previousId

The previous ID that the user was recognized by. This defaults to the currently identified user’s ID.

FAQs

Package last updated on 16 Nov 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