For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
SupportDashboard
DocsAPI ReferenceWebhooksMethodsUI ComponentsMCP ServerChangelog
  • Documentation
    • Introduction
    • Authentication
    • RCS Support
  • Quickstart
    • SMS
      • Python
      • TypeScript
        • Send
        • Receive
      • Ruby
    • RCS
  • Guides
    • Purchase Phone Numbers
    • Brands
    • Campaigns
    • Messages
    • Branded Test Agents
    • Handling Expired URLs
LogoLogo
SupportDashboard
QuickstartSMSTypeScript

Sending SMS Messages

1import { PinnacleClient } from "rcs-js";
2import dotenv from "dotenv";
3
4dotenv.config();
5
6const client = new PinnacleClient({ apiKey: process.env.PINNACLE_API_KEY });
7
8async function sendSMS() {
9try {
10 const res = await client.messages.sms.send({
11 from: process.env.SENDER_NUMBER!,
12 to: "+14151239876", // Recipient number
13 text: "Hello, world!",
14 });
15
16 console.log("✅ Message sent:", JSON.stringify(res, null, 2));
17} catch (err) {
18 console.error("❌ Error sending message:", err);
19}
20}
21
22sendSMS();
Was this page helpful?
Previous

Receiving SMS Messages

Next
Built with

Prerequisites

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

Installation

Initialize a new Node.js project:

$npm init -y

Install the Pinnacle TypeScript SDK and dotenv:

$npm i rcs-js dotenv

Install node types:

$npm i --save-dev @types/node

This guide uses version rcs-js>=2.0.3. 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:

PINNACLE_API_KEY="your_api_key" # pnclk_
SENDER_NUMBER="your_phone_number" # +12345678910

Sending Your First SMS

Create a new TypeScript file (e.g., index.ts) and add the code shown to the right.

Run the script:

$npx tsx index.ts

If successful, the recipient will receive your SMS message! You should also see the result of the message send in your console.