Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@rownd/rcs-business-messaging

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rownd/rcs-business-messaging

A RCS Business Messaging Library for Node

latest
npmnpm
Version
1.1.0
Version published
Maintainers
0
Created
Source

@rownd/rcs-business-messaging

A RCS Business Messaging Library for Node

Installation

npm install @rownd/rcs-business-messaging

Usage

Initialize

import RbmApiHelper, { JWT } from '@rownd/rcs-business-messaging';

// Initialize the Google auth client
const authClient = new JWT(
  '<CLIENT_EMAIL>',
  void 0,
  '<PRIVATE_KEY>',
  [
    'https://www.googleapis.com/auth/rcsbusinessmessaging'
  ]
);

// Initialize RBM API helper
const rbmApiHelper = new RbmApiHelper(authClient);

Send a message

const msisdn = '+19199999999';

// Call checkCapability() to determine if the msisdn supports RCS
try {
  await rbmApiHelper.checkCapability(msisdn);
} catch (err) {
  if (err instanceof GaxiosError && err.response?.status === 404) {
    throw new Error('RCS not supported');
  }
  throw err;
}

const response = await rbmApiHelper.sendMessage({
  messageText: message,
  msisdn: msisdn,
  suggestions: [],
});

Keywords

rcs

FAQs

Package last updated on 04 Nov 2024

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