https://github.com/dittofeed/sdk-node
Dittofeed node SDK, used to send events to Dittofeed from node applications. Dittofeed is an open source customer engagement platform.
https://github.com/dittofeed/sdk-node
customer-engagement nodejs
Last synced: 29 days ago
JSON representation
Dittofeed node SDK, used to send events to Dittofeed from node applications. Dittofeed is an open source customer engagement platform.
- Host: GitHub
- URL: https://github.com/dittofeed/sdk-node
- Owner: dittofeed
- License: mit
- Created: 2023-08-04T18:21:25.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-08-04T02:19:03.000Z (12 months ago)
- Last Synced: 2025-11-02T17:13:21.730Z (9 months ago)
- Topics: customer-engagement, nodejs
- Language: TypeScript
- Homepage: https://www.dittofeed.com/
- Size: 1.13 MB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @dittofeed/sdk-node
Dittofeed node SDK. Use it to send events to Dittofeed, an open source customer engagement platform, from your node application.
## Installation
```bash
# Using Yarn
yarn add @dittofeed/sdk-node
# Using NPM
npm install --save @dittofeed/sdk-node
```
## Usage
```typescript
import { DittofeedSdk } from '@dittofeed/sdk-node';
// Initialize the sdk with a writeKey, which is used to identify your
// workspace. This key can be found at
// https://dittofeed.com/dashboard/settings
await DittofeedSdk.init({
writeKey: "Basic abcdefg...",
});
// Lets you tie a user to their actions and record traits about them. It
// includes a unique User ID and any optional traits you know about the
// user, like their email, name, and more.
DittofeedSdk.identify({
userId: "123",
traits: {
email: "john@email.com",
firstName: "John"
},
});
// The track call is how you record any actions your users perform, along
// with any properties that describe the action.
DittofeedSdk.track({
userId: "123",
event: "Made Purchase",
properties: {
itemId: "abc",
},
});
// Lets you record whenever a user sees a screen, the mobile equivalent of
// page, in your mobile app, along with any properties about the screen.
DittofeedSdk.screen({
userId: "123",
name: "Recipe Screen",
properties: {
recipeType: "Soup",
},
});
// Ensures that asynchronously submitted events are flushed synchronously
// to Dittofeed's API.
await DittofeedSdk.flush();
```