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

@openpromo/meta

v0.0.5

Published

Type-safe TypeScript SDK for the Meta (Facebook) Marketing API — fully typed Graph API client with auto-generated types for 994 API objects

Downloads

81

Readme

@openpromo/meta

Type-safe TypeScript SDK for the Meta (Facebook) Marketing API.

Powering openpromo.app — the AI-native social media workspace.

npm CI License


What

A drop-in typed replacement for facebook-nodejs-business-sdk. Auto-generated from the official API specs — every Graph API object, edge, field, and parameter is typed. Wrong field names, missing required params, and bad enum values fail at compile time, not runtime.

Install

bun add @openpromo/meta
# or
npm install @openpromo/meta

Use

import { Meta } from "@openpromo/meta";

const meta = Meta.createClient({ accessToken: process.env.META_TOKEN! });

// Instagram publishing
const ig = Meta.Instagram.createClient({ api: meta, igAccountId: "ig_123" });
await ig.media.publishVideo({
  videoUrl: "https://cdn.example.com/reel.mp4",
  caption: "New drop 🔥",
});

// Facebook Page publishing
const fb = Meta.Facebook.createClient({
  api: meta,
  pageId: "page_456",
  accessToken: process.env.META_TOKEN!,
});
await fb.feed.publishPost({ message: "Hello Facebook!" });

// Threads
const threads = Meta.Threads.createClient({
  accessToken: process.env.THREADS_TOKEN!,
  threadsUserId: "t_789",
});
await threads.posts.publishText({ text: "Hello Threads!" });

// Graph API with field-level narrowing
const campaign = await meta.adAccount("act_123").campaigns.list({
  fields: ["id", "name", "status"],  // narrows return type
});

Features

  • 994 typed Graph API objects — AdAccount, Campaign, AdSet, Ad, Page, Business, and more
  • 483 real enum values — not string, actual narrowed unions
  • Field-level narrowingPick<CampaignFields, "id" | "name"> on every query
  • Publishing clients — Instagram, Facebook, Threads (photo, video/reel, carousel, story)
  • Full inbox — DMs, comments, private replies with Zod-validated webhook payloads
  • OAuth — token exchange, long-lived tokens, refresh
  • Rate limiting — auto-parses Meta's x-app-usage headers, runtime-agnostic throttling
  • Retry with exponential backoff — automatic recovery from 5xx and network errors
  • Batch API — typed multi-request batches
  • AI SDK tools — 58 filterable tools with middleware and two-stage routing
  • Runtime agnostic — native fetch, no axios

Umbrella package

For a single install covering Meta + TikTok + Google Ads, use @openpromo/ad-platforms.

License

MIT © OpenPromo