npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@autoposting.ai/sdk

v0.3.0

Published

<div align="center">

Downloads

256

Readme

@autoposting.ai/sdk

TypeScript SDK for AI-powered social media automation.

The official Node.js / TypeScript client for the Autoposting.ai API — schedule posts, manage brands, run AI agents, generate content ideas, clip videos, build carousels, and automate social media publishing across X (Twitter), LinkedIn, Instagram, Threads, and YouTube.

npm TypeScript Node License: MIT


Why @autoposting.ai/sdk?

  • AI Agent Friendly — Built for AI agents that need to post to social media. Pairs with the MCP server for Claude Desktop, Cursor, and any MCP-compatible AI assistant.
  • Multi-Platform — One API for X (Twitter), LinkedIn, Instagram, Threads, and YouTube.
  • AI Content Generation — Generate post ideas, rewrite content, score posts, and create carousels with AI.
  • TypeScript-First — Full type definitions, typed errors, and autocomplete for every resource.
  • Zero Dependencies — Uses native fetch (Node.js 20+). No axios, no node-fetch.
  • Lightweight — 13KB bundled (ESM + CJS + type definitions).

Install

npm install @autoposting.ai/sdk
yarn add @autoposting.ai/sdk
pnpm add @autoposting.ai/sdk

Quick Start

import { Autoposting } from '@autoposting.ai/sdk'

const client = new Autoposting({ apiKey: 'sk-social-...' })

// Schedule a post to X and LinkedIn
const post = await client.posts.create({
  brandSlug: 'my-brand',
  text: 'Launching our new AI features today!',
  platforms: ['x', 'linkedin'],
  scheduledAt: '2025-01-15T09:00:00Z',
})

// Publish immediately
await client.posts.publish(post.id)

Usage Examples

Social Media Post Scheduling

// List all scheduled posts
const posts = await client.posts.list({ status: 'scheduled' })

// Create and schedule a post
const post = await client.posts.create({
  brandSlug: 'my-brand',
  text: 'Check out our latest blog post!',
  platforms: ['x', 'linkedin', 'threads'],
  scheduledAt: '2025-02-01T14:00:00Z',
})

// AI-rewrite a post for better engagement
await client.posts.rewrite(post.id)

// Get AI score and feedback
const score = await client.posts.score(post.id)

Brand Management

// List all brands in your workspace
const brands = await client.brands.list()

// Check which platforms are connected
const status = await client.brands.authStatus('my-brand')

AI Agents for Automated Posting

// Create an AI agent that posts daily
const agent = await client.agents.create({
  name: 'Daily Tech News',
  type: 'publish',
  brandSlug: 'my-brand',
  prompt: 'Write a short post about the latest AI news',
  frequency: 'daily',
  time: '09:00',
})

// Trigger an immediate run
await client.agents.run(agent.id)

// View run history
const runs = await client.agents.runs(agent.id)

Knowledge Base & Content Ideas

// Create a knowledge base and ingest content
const kb = await client.kb.create({ name: 'Product Docs' })
await client.kb.ingest(kb.id, { url: 'https://docs.example.com' })

// Search your knowledge base
const results = await client.kb.search(kb.id, { query: 'pricing' })

// Generate content ideas from your KB
const ideas = await client.ideas.generate({
  kbId: kb.id,
  topic: 'product updates',
  count: 10,
})

Video Clips & Carousels

// Import and process a video clip
const clip = await client.clips.import({ url: 'https://youtube.com/watch?v=...' })
await client.clips.render(clip.id)

// AI-generate a carousel from a topic
const carousel = await client.carousels.generate({
  topic: '5 Tips for Social Media Growth',
  brandSlug: 'my-brand',
  slideCount: 5,
})

// Convert carousel to a post draft
await client.carousels.draft(carousel.id)

Webhooks for Real-Time Events

// Get notified when posts are published
const webhook = await client.webhooks.create({
  url: 'https://api.example.com/webhook',
  events: ['post.published', 'post.failed'],
})

// Send a test event
await client.webhooks.test(webhook.id)

Billing & Usage

const billing = await client.billing.status()
const credits = await client.billing.credits()
const usage = await client.usage.summary()

API Reference

Resources

| Resource | Methods | |----------|---------| | client.posts | list · retrieve · create · update · remove · publish · schedule · retry · rewrite · score | | client.brands | list · retrieve · create · update · remove · authStatus | | client.agents | list · retrieve · create · update · remove · run · toggle · runs | | client.kb | list · retrieve · create · remove · search · ingest · docs | | client.ideas | list · generate · enrich · remove | | client.clips | list · retrieve · import · render · remove | | client.carousels | list · retrieve · create · generate · draft · remove | | client.webhooks | list · retrieve · create · update · remove · test | | client.billing | status · credits | | client.usage | summary | | client.workspaces | list · switchWorkspace |

Error Handling

The SDK throws typed errors you can catch by class:

import {
  AutopostingError,     // base class
  AuthenticationError,  // 401 — invalid API key
  ScopeError,           // 403 — insufficient API key scopes
  NotFoundError,        // 404 — resource not found
  ValidationError,      // 400/422 — invalid input
  RateLimitError,       // 429 — rate limited
  ServerError,          // 5xx — server error
} from '@autoposting.ai/sdk'

try {
  await client.posts.retrieve('nonexistent')
} catch (err) {
  if (err instanceof NotFoundError) {
    console.log('Post not found:', err.message)
  }
  if (err instanceof RateLimitError) {
    console.log('Rate limited, retry after:', err.message)
  }
}

Configuration

const client = new Autoposting({
  apiKey: 'sk-social-...',         // required
  baseUrl: 'https://custom.api',   // optional, defaults to production
  timeout: 30000,                  // optional, request timeout in ms
})

Auth Priority (when using with CLI)

--api-key flag  >  AUTOPOSTING_API_KEY env  >  stored credentials

MCP Server for AI Agents

This SDK powers the Autoposting MCP server — 51 tools that let AI agents (Claude, Cursor, GPT) manage social media autonomously.

Install the CLI to get the MCP server:

npm install -g @autoposting.ai/cli
ap mcp  # starts stdio MCP server

Claude Desktop config:

{
  "mcpServers": {
    "autoposting": {
      "command": "ap",
      "args": ["mcp"],
      "env": { "AUTOPOSTING_API_KEY": "sk-social-..." }
    }
  }
}

Once connected, your AI agent can create posts, schedule content, run AI agents, search knowledge bases, and manage your entire social media presence — all through natural language.


CLI

The companion CLI (@autoposting.ai/cli) provides 61 terminal commands:

npm install -g @autoposting.ai/cli

ap posts create --brand my-brand --text "Hello!" --platforms x,linkedin
ap agents run <agent-id>
ap kb search <kb-id> --query "product launch"

See the CLI documentation for the full command reference.


Supported Platforms

| Platform | Post | Schedule | AI Rewrite | Analytics | |----------|------|----------|------------|-----------| | X (Twitter) | Yes | Yes | Yes | Yes | | LinkedIn | Yes | Yes | Yes | Yes | | Instagram | Yes | Yes | Yes | Yes | | Threads | Yes | Yes | Yes | Yes | | YouTube | Yes | Yes | Yes | Yes |


Use Cases

  • Social media automation — Schedule and publish posts across multiple platforms from your app
  • AI agent social media posting — Let AI agents manage your social presence via MCP
  • Content pipeline — Generate ideas → create posts → AI-rewrite → schedule → publish
  • Social media management API — Build custom dashboards and tools on top of the Autoposting API
  • Automated content repurposing — Clip videos, generate carousels, cross-post across platforms
  • CI/CD social media publishing — Automate announcements from your deployment pipeline
  • Knowledge-driven posting — Ingest docs into a KB, generate posts from your own content

License

MIT — see LICENSE.


Built by Autoposting.ai — AI-powered social media scheduling for X, LinkedIn, Instagram, Threads, and YouTube.

Website · CLI · GitHub · @iuditg