the-things-stack-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and authenticate The Things Stack webhooks (The Things Network and The Things Industries LoRaWAN Application Server). Use when creating a custom…
от hookdeck★ 104 звезды на GitHubОб этом скилле
The Things Stack Webhooks
The Things Stack (the LoRaWAN network server behind The Things Network and The Things Industries) can send each application's messages to an HTTP endpoint: uplinks, join-accepts, downlink events, location results. You add a webhook under your application's Integrations > Webhooks in the Console. The Application Server always sends POST requests with a JSON body.
When to Use This Skill
- How do I receive The Things Stack (TTN) uplinks with a webhook?
- How do I authenticate The Things Stack webhook requests? (there's no signature)
- What does "Request authentication" send? (
Authorization: Basic …) - How do I tell uplink, join-accept and downlink messages apart?
- What is the
X-Downlink-Apikeyheader?
Authentication (core)
The Things Stack doesn't sign webhooks. Check Request authentication on the webhook and enter a username and password: the Console stores an Authorization header that the Application Server sends with every request.
Authorization: Basic base64(<username>:<password>)
The docs call it "Authentication: Basic Authorization (headers.Authorization = 'Basic ' + btoa(username + ':' + password)).
const crypto = require('crypto');
const safeEqual = (a, b) => crypto.timingSafeEqual(
crypto.createHash('sha256').update(a).digest(),
crypto.createHash('sha256').update(b).digest());
function verifyBasicAuth(authorization, username, password) {
const match = /^Basic\s+([A-Za-z0-9+/]+={0,2})\s*$/i.exec(String(authorization || ''));
if (!match || !username || !password) return false;
const decoded = Buffer.from(match[1], 'base64').toString('utf8');
const i = decoded.indexOf(':'); // split at the FIRST colon
if (i < 0) return false;
const userOk = safeEqual(decoded.slice(0, i), username);
const passOk = safeEqual(decoded.slice(i + 1), password);
return userOk && passOk;
}
- Compare both values in constant time, and evaluate both before combining, so a wrong username doesn't return faster.
- The password can contain
:. Split at the first colon only. - Missing or wrong credentials:
401. Credentials not configured:500. - Webhooks made with templates, the CLI or the API can set any header, so
Authorizationis just a stored header. Without Request authentication, nothing authenticates the request: use HTTPS and a hard-to-guess path at the least.
For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.
Hookdeck: Hookdeck's The Things Stack source type (THE_THINGS_STACK) checks the basic auth credentials. Enter the same username and password as in Request authentication.
Messages
Every message has end_device_ids, correlation_ids and received_at, plus one message object named after its type:
{
"end_device_ids": { "device_id": "dev1", "application_ids": { "application_id": "app1" }, "dev_eui": "0004A30B001C0530", "dev_addr": "00BCB929" },
"correlation_ids": ["as:up:01E0WZGT6Y7657CPFPE5WEYDSQ"],
"received_at": "2020-02-12T15:15:46.014773143Z",
"uplink_message": {
"f_port": 1, "f_cnt": 1, "frm_payload": "gkHe",
"decoded_payload": { "temperature": 1.0, "luminosity": 0.64 },
"rx_metadata": [{ "gateway_ids": { "gateway_id": "gtw1" }, "rssi": -35, "snr": 5.2 }]
}
}
| Message object | Sent for |
|---|---|
uplink_message |
An uplink. frm_payload is base64; decoded_payload appears when a payload formatter is set |
uplink_normalized |
A normalized uplink |
join_accept |
A device joined |
downlink_ack, downlink_nack, downlink_sent, downlink_failed, downlink_queued, downlink_queue_invalidated |
Downlink events |
location_solved |
A location result |
service_data |
Service data |
Fields whose value is "", 0 or false are left out of the payload. See references/overview.md.
Headers
| Header | When |
|---|---|
Authorization |
Request authentication is on (or you set it yourself) |
X-Downlink-Apikey, X-Downlink-Push, X-Downlink-Replace |
A Downlink API key is set. The key can schedule downlinks: don't log it |
X-Tts-Domain |
The deployment's domain |
Environment Variables
TTS_WEBHOOK_USERNAME=your-username # the same values as in Request authentication
TTS_WEBHOOK_PASSWORD=your-password
Local Development
# Express / Next.js (use 8000 for FastAPI). No install or account required.
npx hookdeck-cli listen 3000 the-things-stack --path /webhooks/the-things-stack
Use the printed URL as the webhook's Base URL, turn on Request authentication with the same credentials, and enable Uplink message. See references/setup.md.
Reference Materials
- [references/overview.md](referenc
Установить the-things-stack-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл the-things-stack-webhooks?
Receive and authenticate The Things Stack webhooks (The Things Network and The Things Industries LoRaWAN Application Server). Use when creating a custom webhook in the Console, enabling Request authentication (Authorization: Basic header), checking basic auth credentials, choosing enabled event types and paths, handling the X-Downlink-Apikey header, or processing uplink_message, join_accept, downlink_ack, downlink_failed and location_solved messages.
Как установить скилл the-things-stack-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл the-things-stack-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic