Documentation/Gadget Trade/Integrations, Webhooks & Developer Security
Gadget Trade

Integrations, Webhooks & Developer Security

A practical integration guide covering API credentials, trusted domains, callbacks, webhook verification, retries and safe server-side architecture.

Keep secrets server-side

Never put a secret API key, webhook signing secret or privileged access token in browser JavaScript. Use environment variables on a server or trusted backend.

Webhooks

  1. 1Register the HTTPS callback URL with the provider.
  2. 2Verify the provider’s callback challenge where required.
  3. 3Verify webhook signatures before processing events.
  4. 4Return the required success response quickly.
  5. 5Process events idempotently so duplicate deliveries do not create duplicate records.

Retries and event processing

Webhooks are commonly delivered on an at-least-once basis. Store an event ID or other stable identifier and make handlers safe to retry. Use queues or background processing when an event requires expensive work.

Facebook / Meta integrations

Meta integrations commonly use an app, access tokens and permission scopes. Meta’s official API collections document Page access tokens and Page tasks for managed Pages, as well as messaging and publishing workflows. Keep access tokens server-side and request only the permissions the product actually needs.

Instagram integrations

Meta’s current Instagram API documentation covers Professional accounts, content publishing, comments, mentions, insights and messaging. The API distinguishes Facebook Login and Instagram Login setups, and the supported scopes and account requirements differ. Do not assume a consumer Instagram account has the same API access as a Professional account.

WhatsApp Business Platform

WhatsApp Cloud API is designed for business messaging and uses a WhatsApp Business Account, business phone number, access tokens and webhook subscriptions. Inbound messages and status events should be handled through the configured webhook endpoint, with credentials kept on the server.

TikTok integrations

TikTok’s current developer documentation covers OAuth, trusted domains, URL ownership verification, Content Posting API, creator information, publishing status and webhooks. Direct posting requires the relevant authorised scope, and TikTok documents moderation/processing states before public availability.

Social-platform integrations

Third-party platforms such as TikTok and Meta use scopes, redirect URIs, trusted domains, webhooks and explicit user authorisation. Integration documentation should describe what data or publishing capability is requested and why.

Research notes for social integrations

TikTok’s current developer documentation requires registered/trusted domains for relevant requests, URL ownership verification for certain features and HTTPS webhook callbacks. TikTok also documents webhook signature verification and at-least-once delivery.

Meta’s WhatsApp Cloud API documentation similarly uses business accounts, access tokens and webhook subscriptions for business messaging. Treat provider-specific rules as changing documentation rather than hard-coded assumptions.

Frequently asked questions

Can I call a privileged API directly from the browser?+

Do not expose privileged secrets in browser code. Put the provider request behind a trusted server route.

Why should webhook handlers be idempotent?+

Providers can retry deliveries or deliver an event more than once. Idempotent processing prevents duplicate orders, messages, notifications or other side effects.

Do Meta and TikTok integrations require the same permissions?+

No. Each provider defines its own scopes, consent, review, redirect, domain and webhook requirements. Request only the capabilities the integration actually needs.