npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tridentity/tri-com-be-sdk

v1.0.4

Published

The Tri Communication SDK is a tool designed to integrate with the Tri Communication Service, providing key communication functionalities such as sending messages, notifications, creating chat rooms, and user authentication.

Downloads

32

Readme

Tridentity Communication Service SDK

The Tri Communication SDK is a tool designed to integrate with the Tri Communication Service, providing key communication functionalities such as sending messages, notifications, creating chat rooms, and user authentication.

Installation

First, install the SDK in your project:

npm install --save @tridentity/tri-com-be-sdk

Initialization

To initialize, provide the API baseURL, clientId, and clientSecret.

  • For testing, use Staging URL: https://communication-service.stag.tribox.me
  • For production, use Production URL:
const client = new TriCommunicationClient({
  url: "TRI_COMMUNICATION_URL",
  clientId: "YOUR_CLIENT_ID",
  clientSecret: "YOUR_CLIENT_SECRET",
});

Notes

  • Ensure that your clientId and clientSecret is kept secure and not shared publicly.
  • Always handle network and server errors when using the SDK.

Tri Communication SDK API Methods

Below is the documentation for key methods in the Tri Communication SDK. These methods allow you to interact with the Tri Communication platform, such as registering users, retrieving user signatures, and sending notifications.


addUser

Registers a user on the Tri Communication platform.

Method
async addUser(name: string, prefix: TriCommunicationRolePrefix): Promise<{ userId: string, message: string }>
Parameters

| Parameter | Type | Required | Description | | --------- | ---------------------------- | -------- | ------------------------------------------------------------------------- | | name | string | Yes | The name of the user to register. | | prefix | TriCommunicationRolePrefix | Yes | A role prefix to categorize the user (e.g., "admin", "user", "merchant"). |

Returns

A promise that resolves to an object containing the userId of the registered user.

Example Usage
const user = await client.addUser("John Doe", TriCommunicationRolePrefix.USER);
console.log(user.userId); // Outputs the registered userId

getUserSignature

Fetches the signature for a user from the Tri Communication platform.

Method
async getUserSignature(triCommunicationUserId: string): Promise<{ signature: string }>
Parameters

| Parameter | Type | Required | Description | | ------------------------ | -------- | -------- | ---------------------------------------- | | triCommunicationUserId | string | Yes | The ID of the user on Tri Communication. |

Returns

A promise that resolves to an object containing the signature of the user.

Example Usage
const signature = await sdk.getUserSignature("66f13078f1501545550abcce");
console.log(signature); // Outputs the user's signature

sendNotification

Sends a notification to a single user on the Tri Communication platform.

Method
async sendNotification(body: ISendNotiToUser): Promise<{ status: string }>
Parameters

| Parameter | Type | Required | Description | | --------- | ----------------- | -------- | ------------------------------------------- | | body | ISendNotiToUser | Yes | An object containing the notification data. |

ISendNotiToUser Interface

| Field | Type | Required | Description | | ----------- | -------- | -------- | ------------------------------------------------------ | | toAccount | string | Yes | The account ID of the user receiving the notification. | | notiBody | any | Yes | The content of the notification message. |

Returns

A promise that resolves to an object containing the status of the operation.

Example Usage
const notification = {
  toAccount: "66f13078f1501545550abcce",
  notiBody: { title: "New Message", content: "You have a new message." },
};

const response = await sdk.sendNotification(notification);
console.log(response.status); // Outputs the status of the notification

sendNotificationToMultipleUsers

Sends a notification to multiple users on the Tri Communication platform.

Method
async sendNotificationToMultipleUsers(body: ISendNotiToUserToMultipleUsers): Promise<{ status: string }>
Parameters

| Parameter | Type | Required | Description | | --------- | -------------------------------- | -------- | ------------------------------------------- | | body | ISendNotiToUserToMultipleUsers | Yes | An object containing the notification data. |

ISendNotiToUserToMultipleUsers Interface

| Field | Type | Required | Description | | ------------ | ---------- | -------- | ---------------------------------------------------- | | toAccounts | string[] | Yes | An array of account IDs to receive the notification. | | notiBody | any | Yes | The content of the notification message. |

Returns

A promise that resolves to an object containing the status of the operation.

Example Usage
const notifications = {
  toAccounts: ["user_12345", "user_67890", "user_11223"],
  notiBody: {
    title: "System Update",
    content: "Scheduled maintenance at 12:00 AM.",
  },
};

const response = await sdk.sendNotificationToMultipleUsers(notifications);
console.log(response.status); // Outputs the status of the notifications

Notes

  • Ensure all toAccount or toAccounts IDs are valid and registered on the Tri Communication platform.
  • The notiBody field can contain any data structure that your application supports for notifications.
  • Handle potential errors, such as network issues or invalid inputs, when calling these methods.

Contact

For more details or support, please contact the Tri Communication development team.