> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.pinnacle.sh/v-2/quickstart/sms/typescript/send/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pinnacle.sh/_mcp/server. # Sending SMS Messages > Sending your first SMS with Pinnacle's TypeScript SDK ```typescript import { PinnacleClient } from "rcs-js"; import dotenv from "dotenv"; dotenv.config(); const client = new PinnacleClient({ apiKey: process.env.PINNACLE_API_KEY }); async function sendSMS() { try { const res = await client.messages.sms.send({ from: process.env.SENDER_NUMBER!, to: "+14151239876", // Recipient number text: "Hello, world!", }); console.log("✅ Message sent:", JSON.stringify(res, null, 2)); } catch (err) { console.error("❌ Error sending message:", err); } } sendSMS(); ``` ## Prerequisites Before proceeding, ensure you have obtained a phone number and API key as described in the [prerequisites](/quickstart/sms). ## Installation Initialize a new Node.js project: ```bash npm init -y ``` Install the Pinnacle TypeScript SDK and dotenv: ```bash npm i rcs-js dotenv ``` Install node types: ```bash npm i --save-dev @types/node ``` > **Info** > > 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: ```bash 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. > One API for RCS, iMessage, MMS, and SMS. Build, test, and scale every channel — send your first message in minutes, not weeks.