Before proceeding, ensure you have obtained a phone number and API key as described in the prerequisites.
Initialize a new Node.js project:
Install the Pinnacle TypeScript SDK and Express:
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.
Create an .env file in your project root and add your Pinnacle API key and signing secret:
To receive inbound SMS messages, you need to configure a webhook in the Pinnacle dashboard:
localhost:3000/inbound-sms.env fileOptionally, you can configure custom HTTP headers (e.g. X-API-KEY) to be
sent on every webhook delivery. Add them in the dashboard or via the
headers field on POST /webhooks/attach.
The PINNACLE-SIGNING-SECRET header is reserved.
Create a new TypeScript file (e.g., index.ts) and add the following snippet to the right.
The code above creates an Express endpoint that:
/inbound-smsStart the server:
Your server will start on http://localhost:3000. If you’re using ngrok for local development, start it in a separate terminal:
Use the ngrok URL (e.g., https://abc123.ngrok.io/inbound-sms) as your webhook endpoint in the Pinnacle dashboard.
Send an SMS to your Pinnacle phone number from any mobile device. You should see the message logged in your server console:
If you’re not receiving any messages, make sure you have a phone number associated with your webhook.
Your webhook should now be successfully receiving inbound SMS messages as well message status updates for outbound messages!
For more detail about processing the message payload received, please view the process method.
Optionally, you can also create the /send-sms/:phone_number endpoint to send an initial SMS message out.