Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
deepin-js-sdk
Advanced tools
deepin sdk can be used in react, vue, svelte, react-native, nodeJs, flutter, cordova and in other capacities you may require that can run javascript code as follows:
You can use one of the following commands to install the sdk.
npm i deepin-js-sdk
yarn add deepin-js-sdk
The following code shows you how could it be imported in es6 or 7 or typescript.
import deepIn from 'deepin-js-sdk'
...
Copy the following line in an html file
<script src="https://dash.mydeepin.ir/download/deepin-js-sdk-v1.1.3.js"></script>
<script>
const deepIn = window.Deepin
...
</script>
yarn add deepin-js-sdk
npm i deepin-js-sdk
const deepIn = require('deepin-js-sdk')
...
First you need to create a new source(web sdk) in deepin panel and get a writekey then use deepin
instance to be able to initialize it by the following code:
deepIn.init(writeKey);
Now you are ready to send events using this instance, It creates a bundle of events and send them together by default. Thus, for the first time you can use the following code to send a page event instantly and check whether the event has been sent successfully.
deepIn.init(writekey);
deepIn.page() // calls a page event
deepIn.flush() // cleanse the queue and sends all the events
Use the init method to initialize the deepIn SDK.
deepIn.init(writeKey);
The given writekey for the source you have created in deepin panel.
Use the identify method to link your users and their actions, to a recognizable userId and traits.
deepIn.identify(userId, [traits]);
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.
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",
});
The Track method lets you record actions your users perform.
deepIn.track(event, [properties]);
The name of the event you’re tracking.
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
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]);
The category of the page. Useful for cases like ecommerce where many pages might live under a single category.
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",
});
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]);
The Group ID to associate with the current user.
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",
});
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]);
The new user ID you want to associate with the user.
The previous ID that the user was recognized by. This defaults to the currently identified user’s ID.
FAQs
Javascript SDK to use deepin platform
The npm package deepin-js-sdk receives a total of 1 weekly downloads. As such, deepin-js-sdk popularity was classified as not popular.
We found that deepin-js-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.