Pinnacle

Sending RCS Messages

Sending your first RCS message with Pinnacle's TypeScript SDK

Prerequisites

Before proceeding, ensure you have obtained a phone number and API key as described in the prerequisites.

Installation

Install the Pinnacle TypeScript SDK, dotenv, and TypeScript type definitions:

Shell
npm init -y
npm pkg set type=module
npm i rcs-js@2.0.25 dotenv
npm i --save-dev @types/node

This guide uses version rcs-js 2.0.25. It's compatible with the following runtimes: Node.js 18+, Vercel, Cloudflare Workers, Deno v1.25+, Bun 1.0+, and React Native.

Configuration

Create an .env file in your project root and add your Pinnacle API key and RCS agent ID:

Shell
PINNACLE_API_KEY="your_api_key" # pnclk_
RECIPIENT_NUMBER="+14155550123" # Replace with your whitelisted test number
AGENT_ID="your_agent_id" # agent_

Sending Your First RCS Message

Create a new TypeScript file (e.g., index.ts) and use the complete example.

Quick replies are optional. For sending media urls, you can also use storage on the dashboard under System > Storage or via our API

Run the script:

Shell
npx tsx index.ts

If successful, you should receive 2 texts to your device (a basic text with quick replies and a card with quick replies). You can see more properties for RCS messages in the API reference.

Pinnacle referenceAsk Pinnacle

Get a sourced answer from the published documentation.

ViewingPinnacle documentation

Conversations are saved for analysis.

Try asking