Guides/Node.js

Post to social media from Node.js

One SDK call to publish or schedule across connected accounts. Connect Links handle OAuth; webhooks confirm publish.

~15 minNode.js 18+TypeScript optional
Prerequisites
  • Node.js 18+
  • npm or pnpm
  • • An Aether account — free, no credit card

Step 1Install the SDK

The published package is aether. It wraps every REST endpoint with typed methods.

npm install aether

Step 2Create a client

Store the key in an environment variable. Never ship it to the browser.

import Aether from "aether";

export const aether = new Aether({
  apiKey: process.env.AETHER_API_KEY!,
});

Step 3Connect a social account

Connect Links open the platform OAuth screen. After the user authorizes, you get a profileId.

const link = await aether.connectLinks.create({
  platform: "instagram",
  redirectUrl: "https://yourapp.com/connected",
});

console.log(link.url); // send this to the account owner

Step 4Post immediately

Pass one or more profileIds. Aether publishes to every connected profile in the array.

const post = await aether.posts.create({
  text: "Shipped from Node.js today.",
  profileIds: ["ig_abc123", "li_company789"],
  mediaUrls: ["https://your-cdn.com/launch.png"],
});

console.log(post.data.id, post.data.status);

Step 5Schedule a post

scheduledFor is ISO 8601. Aether queues the job and fires post.published when it goes live.

await aether.posts.create({
  text: "Queued for the morning standup.",
  profileIds: ["ig_abc123"],
  scheduledFor: "2026-08-20T13:00:00Z",
});

Step 6Confirm with a webhook

Register an HTTPS endpoint. Verify the HMAC signature before you trust the payload.

import { createHmac, timingSafeEqual } from "node:crypto";
import http from "node:http";

http.createServer((req, res) => {
  const chunks: Buffer[] = [];
  req.on("data", (c) => chunks.push(c));
  req.on("end", () => {
    const raw = Buffer.concat(chunks);
    const sig = String(req.headers["x-aether-signature"] ?? "");
    const expected = createHmac("sha256", process.env.AETHER_WEBHOOK_SECRET!)
      .update(raw)
      .digest("hex");
    if (!timingSafeEqual(Buffer.from(sig), Buffer.from(expected))) {
      res.writeHead(401);
      res.end();
      return;
    }
    const event = JSON.parse(raw.toString());
    console.log(event.event, event.data?.id);
    res.writeHead(200);
    res.end("ok");
  });
}).listen(3000);
What you've covered
  • npm install aether
  • Connect Links for OAuth
  • Immediate and scheduled posts.create()
  • HMAC-verified webhooks

Start building

Free API key — 3 connected accounts, all endpoints, no credit card.