Sociova β Automate Instagram with clean Node.js code
Stop writing repetitive fetch calls and JSON payloads. Sociova wraps the Instagram Messaging endpoints into simple functions so you can ship faster. Works great for bots, CRMs, automations, and internal tools.
SDK-focused DX: clean methods, consistent payload shapes.
No more manual URL building, headers, and complex JSON bodies. Use straightforward methods like sendMessage(), sendAttachment(), and sendReaction().
Perfect for quick replies, support bots, lead capture flows, and CRM integrations β without rewriting request logic across projects.
Send multiple images via attachments array. Keep your message payloads consistent and predictable.
React/unreact on messages with a single call. Great for quick UX signals, confirmations, and lightweight automation feedback.
Works smoothly inside Next.js Route Handlers (app/api/*) and Node scripts β ideal for building dashboards and backend workflows.
Quickstart examples you can paste into your project. Less reading, more shipping.
Quickstart
Install Sociova, add your access token to environment variables, and send your first Instagram message.
Run in terminal:
npm i sociovaAdd these variables to your environment (local or deployment).
INSTAGRAM_USER_ACCESS_TOKEN="your-access-token" RECIPIENT_ID="the-igsid-you-want-to-message" MESSAGE_ID="for reactions (optional)"
- Builds the correct request body for messages, attachments, stickers, and reactions.
- Adds headers (Authorization + JSON content type) automatically.
- Keeps your code readable and consistent across projects.
Example usage (copy-paste ready):
import { InstaClient } from "sociova";
const client = new InstaClient({
auth: process.env.INSTAGRAM_USER_ACCESS_TOKEN!,
});
// 1) Send a text message
await client.sendMessage({
recepientId: process.env.RECIPIENT_ID!,
message: "Hey! This was sent via Sociova SDK π",
});
// 2) Send multiple images
await client.sendAttachment({
recepientId: process.env.RECIPIENT_ID!,
attachments: [
{ type: "image", payload: { url: "https://humkind.in/logo.png" } },
{ type: "image", payload: { url: "https://humkind.in/favicon.ico" } },
],
});
// 3) React to a specific message
await client.sendReaction({
recepientId: process.env.RECIPIENT_ID!,
messageId: process.env.MESSAGE_ID!,
reaction: "love", // or "π" or "π" or "π"
action: "react", // "unreact" to remove
});Interactive Button Templates
Send interactive button templates in Instagram DMs. Perfect for lead capture, onboarding flows, support menus, and call-to-action prompts.
A button template message allows you to send a message that contains text and up to three attached buttons that allow the message recipient to choose from different options. The buttons can open web pages in the in-app browser or send the recipient's selection to you via the messaging_postback webhook notification. You can then send information about the selection back to the recipient.
- Website redirect buttons
- Postback buttons for automation logic
- Multi-option user flows inside DMs
- Structured CTA messaging
- Best CRM Architecture

await client.sendButtonTemplate({
recipientId: process.env.RECIPIENT_ID!,
text: "What would you like to do?",
buttons: [
{
type: "web_url",
title: "Visit Website",
url: "https://yourwebsite.com"
},
{
type: "postback",
title: "Start Now",
payload: "START_FLOW"
}
]
});