Meta for Developers Integration Guide

Technology: meta-developers · Category: comms · Last reviewed: 2026-08-23

Source: https://tech-stack.codeamanilabs.org/guide/meta-developers

Insight:

Everything Meta lets you build — WhatsApp, Messenger, Instagram, Login, Marketing — is one Graph API (graph.facebook.com/{version}) wearing different hats. Learn Graph fundamentals (nodes/edges, tokens, app types, webhook HMAC) once and every product becomes familiar. For codeAmani's Kenyan-business work, the killer surface is the WhatsApp Business Platform: it is the dominant chat app in East Africa, and Flows + templates turn a WhatsApp thread into a full booking/ordering app without the customer installing anything.

███╗   ███╗███████╗████████╗ █████╗     ██████╗ ███████╗██╗   ██╗
████╗ ████║██╔════╝╚══██╔══╝██╔══██╗    ██╔══██╗██╔════╝██║   ██║
██╔████╔██║█████╗     ██║   ███████║    ██║  ██║█████╗  ██║   ██║
██║╚██╔╝██║██╔══╝     ██║   ██╔══██║    ██║  ██║██╔══╝  ╚██╗ ██╔╝
██║ ╚═╝ ██║███████╗   ██║   ██║  ██║    ██████╔╝███████╗ ╚████╔╝
╚═╝     ╚═╝╚══════╝   ╚═╝   ╚═╝  ╚═╝    ╚═════╝ ╚══════╝  ╚═══╝

Meta for Developers Integration Guide

Focus — the whole Meta developer surface as one platform: Graph API fundamentals, app creation, the token/permission model, webhooks, and the consumer-facing products (WhatsApp, Messenger, Instagram, Login, Marketing API), capped with a catalog of business build ideas for the Kenyan community. For the deep messaging-only reference (send/template/Twilio-vs-Meta) see the focused whatsapp-business-api guide — this guide is the platform-wide course around it.

Overview

Meta for Developers is a single platform exposed through one base URL — https://graph.facebook.com/{version}/{node-or-edge}. WhatsApp Cloud API, Messenger, Instagram, Marketing API, and Pages are all specialized layers over the Graph. Five things are worth internalizing before you write a line of code:

  1. Everything is the Graph API. Master nodes/edges/fields, versioning, and error codes once; every product reuses them.
  2. App type is a permanent decision. A Business app (WhatsApp, Pages, Marketing) uses access levels (Standard → Advanced via App Review). A Consumer app uses app modes (Dev/Live). You cannot convert one to the other — recreate the app if you chose wrong.
  3. Tokens are a taxonomy, not a single thing. User tokens expire fast; system user tokens are the production credential for server automation.
  4. Webhook HMAC is the security perimeter. Every event is signed with X-Hub-Signature-256 (HMAC-SHA256 of the raw body keyed with your App Secret). Validate with a constant-time compare before parsing.
  5. WhatsApp pricing is per-message (since July 2025) and messaging limits are portfolio-wide (since Oct 2025), starting at 250 unique users / 24h and scaling algorithmically: 250 → 2,000 → 10,000 → 100,000 → unlimited.

Official Documentation

Topic URL
Docs index (product map) https://developers.facebook.com/docs/
Graph API https://developers.facebook.com/docs/graph-api/
Create an App / App Types https://developers.facebook.com/docs/development/create-an-app/
WhatsApp Cloud API https://developers.facebook.com/docs/whatsapp/cloud-api
WhatsApp Flows https://developers.facebook.com/docs/whatsapp/flows
WhatsApp pricing & limits https://developers.facebook.com/docs/whatsapp/pricing
Webhooks https://developers.facebook.com/docs/graph-api/webhooks/getting-started
Messenger Platform https://developers.facebook.com/docs/messenger-platform/
Instagram Platform https://developers.facebook.com/docs/instagram-platform/
Official WhatsApp Node SDK https://whatsapp.github.io/WhatsApp-Nodejs-SDK/
Meta Business SDK (Node) https://github.com/facebook/facebook-nodejs-business-sdk

The platform map

Family Products
Core Graph API, App Development, Webhooks, App Dashboard
Business Messaging WhatsApp Business Platform (Cloud API), WhatsApp Flows, Messenger, Instagram Messaging
Social Pages API, Instagram Platform, Threads API, Sharing, Stories
Identity Facebook Login, Facebook Login for Business
Ads & Commerce Marketing API, Conversions API, Catalog, Commerce Platform
SDKs JS SDK, Android, iOS, whatsapp (Node), Meta Business SDK

Always pin a version (v26.0+, current stable — released 2026-07-29). Unversioned calls default to the oldest supported version — a silent footgun.

Setup — register, create an app, add a product

  1. Register at developers.facebook.com with a Facebook account; land in the App Dashboard.
  2. Create App via the modern use-case flow — a use case auto-attaches the permissions/features/products it needs. You receive an App ID + App Secret (your OAuth client credentials — the secret never ships to a client).
  3. Add Product → WhatsApp → Set up provisions a test WABA, a test phone number (free messages to 5 verified recipients), and the pre-approved hello_world template.

Tokens at a glance

Token Lifetime Use
User access token (short) ~1–2 h Client reads after login
User access token (long) ~60 days Server calls on behalf of a user
App access token Long App config, webhook subscriptions
System user token Configurable / non-expiring Production server automation (WhatsApp standard)
Business integration token Long Multi-tenant SaaS acting on a customer's WABA (via Embedded Signup)

Harden server-to-server calls with appsecret_proof (HMAC-SHA256 of the access token keyed with the App Secret) and enable Require App Secret so a stolen bare token is useless. See examples/graph-api-call.ts.

Quickstart

First Graph API call (official Meta Business SDK, Node)

npm install facebook-nodejs-business-sdk
// Read the node behind a token, then walk an edge. Same pattern for every product.
const adsSdk = require("facebook-nodejs-business-sdk");
adsSdk.FacebookAdsApi.init(process.env.META_SYSTEM_USER_TOKEN);
// e.g. account.read([...]) / account.getCampaigns([...]) for Marketing API

First WhatsApp message (official whatsapp SDK, verified quickstart)

npm install whatsapp
# .env: WA_PHONE_NUMBER_ID=  CLOUD_API_ACCESS_TOKEN=  CLOUD_API_VERSION=v26.0
import WhatsApp from "whatsapp";

const wa = new WhatsApp(Number(process.env.WA_PHONE_NUMBER_ID)); // sender phone-number id

async function sendMessage(recipient) {
  // text() works only inside the 24h service window; use template() to initiate.
  const res = await wa.messages.text({ body: "Habari! Your order has shipped." }, recipient);
  console.log((await res).rawResponse());
}

For raw curl/PowerShell sends, interactive messages, templates, and media, the focused whatsapp-business-api guide has the runnable recipes. This guide owns the platform-wide patterns below.

Key patterns

Webhooks (the universal push channel)

One mechanism delivers inbound WhatsApp/Messenger/Instagram messages, delivery statuses, template-review outcomes, Page events, and more — all as signed HTTPS POSTs. The contract is always:

See examples/webhook-router.ts for a complete queue-first receiver.

WhatsApp Flows — chat that behaves like an app

Flows ship multi-screen native UI (forms, booking, lead-gen) inside the thread. Static Flows (pure Flow JSON) deliver collected data to your webhook on completion; Dynamic Flows add an encrypted data endpoint for live validation/availability. Published Flows can only be deprecated, not deleted. See examples/booking-flow.json for a Kenyan-business intake Flow.

Embedded Signup — onboard other businesses

For Tech Providers/agencies: a Meta-hosted popup (built on Facebook Login for Business) that creates/links a customer's portfolio + WABA + phone number and returns a code your server exchanges for a business token scoped to that customer. This is how you operate WhatsApp for many SMEs from one dashboard.

Build ideas for Kenyan businesses

WhatsApp is the default channel in East Africa, so the highest-leverage builds pair a WhatsApp surface with M-Pesa (see MPESA_PATTERNS.md / daraja-api). A starter catalog — the full list with effort/revenue notes is in reference/build-ideas-kenya.md:

  1. Duka order bot — a WhatsApp Flow catalog + cart; checkout fires an M-Pesa STK Push; utility template confirms inside the free service window.
  2. Boda / delivery dispatch — inbound location message → assign rider → delivery-status templates; rider replies drive the 24h window.
  3. Clinic / salon booking — a booking Flow writes to Neon; reminder utility templates 24h before; reschedule via reply buttons.
  4. Sacco / chama assistant — members check balances and contribution status; authentication templates send OTPs; statements as document messages.
  5. School fees & comms — fee-balance utility templates + an M-Pesa paybill link; broadcast announcements via marketing templates (with opt-out).
  6. Agri price & advisory — daily market-price templates by crop; a Flow captures produce listings; buyers reply to express interest.

Every one of these is a thin WhatsApp/Flows front-end over the codeAmani stack (Next.js + Neon/Supabase + Daraja), which is exactly the build sweet spot.

codeAmani notes

Official docs: