tiktok-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify TikTok for Developers webhooks (Login Kit, Content Posting, Data Portability). Use when setting up TikTok webhook handlers, debugging…
от hookdeck★ 104 звезды на GitHubОб этом скилле
TikTok Webhooks
Webhooks from the TikTok for Developers platform (developers.tiktok.com) — Login Kit, Content Posting / Video Kit, and Data Portability. These are not TikTok Shop webhooks, which use a different portal and signature scheme — see tiktok-shop-webhooks.
When to Use This Skill
- How do I receive TikTok webhooks?
- How do I verify the TikTok-Signature header?
- Why is my TikTok webhook signature verification failing?
- How do I handle authorization.removed, post.publish.complete, post.publish.failed, or portability.download.ready events?
- How do I reject replayed TikTok webhook deliveries?
Verification (core)
TikTok has no webhook SDK — verify manually. The TikTok-Signature header
looks like t=1633174587,s=<hex>. The signature is HMAC-SHA256(client_secret, "<t>.<raw_body>"), hex-encoded. Verify against the raw request body (don't
JSON.parse first) and reject stale timestamps to block replay.
const crypto = require('crypto');
function verifyTikTokWebhook(rawBody, header, clientSecret, toleranceSec = 300) {
if (!header || !clientSecret) return false;
const parts = Object.fromEntries(
header.split(',').map((kv) => kv.split('='))
);
const { t, s } = parts;
if (!t || !s) return false;
// Reject stale timestamps (no tolerance window is documented; 5 min is sane).
const age = Math.abs(Math.floor(Date.now() / 1000) - Number(t));
if (!Number.isFinite(age) || age > toleranceSec) return false;
const raw = Buffer.isBuffer(rawBody) ? rawBody.toString('utf8') : rawBody;
const expected = crypto
.createHmac('sha256', clientSecret)
.update(`${t}.${raw}`, 'utf8')
.digest('hex');
try {
return crypto.timingSafeEqual(Buffer.from(s, 'hex'), Buffer.from(expected, 'hex'));
} catch {
return false; // length mismatch = invalid
}
}
For complete handlers with route wiring, event dispatch, and tests, see:
Common Event Types
TikTok documents nine webhook events on two pages: four on Webhooks - Events and five Content Posting events on Get Post Status. Configuring a callback URL subscribes your app to all of them.
| Event | Triggered When |
|---|---|
authorization.removed |
A user deauthorizes your app (access token already revoked) |
portability.download.ready |
Data requested via the Data Portability API is ready to download |
post.publish.failed |
A Content Posting API post fails (reason gives the failure) |
post.publish.complete |
The user creates a post from content you sent (can fire more than once per publish_id) |
post.publish.inbox_delivered |
An upload-endpoint draft reached the creator's inbox |
post.publish.publicly_available |
A post from your content became publicly viewable (post_id now available) |
post.publish.no_longer_publicaly_available |
That post stopped being publicly viewable (TikTok's spelling) |
video.upload.failed |
A video shared through the deprecated Share Video API (Video Kit) fails to upload |
video.publish.completed |
A video shared through the deprecated Share Video API is published by the user |
Watch the exact names: Content Posting uses
post.publish.complete, while the older Share Video API usesvideo.publish.completed. TikTok prints no example body for thepost.publish.*events. See references/overview.md for payload details.
Payload Structure
Events are POSTed as JSON:
{
"client_key": "bwo2m45353a6k85",
"event": "video.publish.completed",
"create_time": 1615338610,
"user_openid": "act.example12345Example12345Example",
"content": "{\"share_id\":\"video.6974245311675353080.VDCxrcMJ\"}"
}
content is a serialized JSON string — parse it separately after parsing
the envelope. portability.download.ready has no user_openid.
Environment Variables
TIKTOK_CLIENT_SECRET=your_app_client_secret # signs the webhook; from the developer portal
The webhook signing key is your app's client secret — the same secret used for OAuth. There is no separate webhook secret.
Local Development
# Start tunnel (no account needed)
npx hookdeck-cli listen 3000 tiktok --path /webhooks/tiktok
Register the printed HTTPS URL as your callback URL in the TikTok developer portal. Configuring a callback URL subscribes your app to every event.
Reference Materials
- references/overview.md - TikTok webhook concepts, events, payloads
- references/setup.md - Developer portal configuration
- [references/verification.md](references/verific
Установить tiktok-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл tiktok-webhooks?
Receive and verify TikTok for Developers webhooks (Login Kit, Content Posting, Data Portability). Use when setting up TikTok webhook handlers, debugging TikTok-Signature verification, or handling events like authorization.removed, post.publish.complete, post.publish.failed, or portability.download.ready. Not for TikTok Shop — see tiktok-shop-webhooks.
Как установить скилл tiktok-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tiktok-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic