Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

360learning-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive and verify 360Learning webhooks (learning platform, delivered through Svix). Use when creating 360Learning webhook subscriptions, debugging…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

360Learning Webhooks

360Learning sends webhooks when things happen on a learning platform: users are created or updated, learners finish course attempts, path session statuses change, certificates are awarded, groups and skills change. Each subscription covers one event type and one URL, and has its own signing secret. 360Learning delivers through Svix and signs each POST in the Standard Webhooks format.

When to Use This Skill

  • How do I receive 360Learning webhooks?
  • How do I verify a 360Learning webhook signature?
  • Where do I find the 360Learning webhook signing secret?
  • Why does my 360Learning signature never match? (usually: the body was re-serialised, or the secret wasn't base64-decoded)
  • How do I rotate a 360Learning signing secret without downtime?
  • How do I handle course.attempt.closed or path.session.user.status.updated?

Verification (core)

Header Value
webhook-id Unique event ID, the same on every retry
webhook-timestamp Unix seconds when this attempt was emitted
webhook-signature Space-separated v1,<base64 HMAC-SHA256> entries (two after a rotation)

Signed content is {webhook-id}.{webhook-timestamp}.{raw body}. The HMAC key is the base64-decoded signing secret: 360Learning's sample decodes it with Buffer.from(signingSecret, "base64"). Its docs show the secret only as a placeholder (password123) and don't mention a whsec_ prefix; strip one if present, then decode.

const crypto = require('crypto');

function verify360LearningWebhook(rawBody, headers, secret) {   // rawBody: exact bytes, NOT JSON.stringify(req.body)
  const id = headers['webhook-id'];
  const timestamp = headers['webhook-timestamp'];
  const signatureHeader = headers['webhook-signature'];
  if (!id || !timestamp || !signatureHeader || !secret) return false;

  const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');   // decode, don't use the string
  const expected = crypto.createHmac('sha256', key)
    .update(`${id}.${timestamp}.`).update(rawBody).digest();

  // Check every v1 entry (new and legacy secret both sign for 24h after a rotation).
  return signatureHeader.trim().split(/\s+/).some((entry) => {
    const [version, signature] = entry.split(',');
    if (version !== 'v1' || !signature) return false;
    const given = Buffer.from(signature, 'base64');
    return given.length === expected.length && crypto.timingSafeEqual(given, expected);
  });
}

Fail closed: return 500 if the secret is unset and 400 if verification fails. Python uses the same steps with base64.b64decode, hmac.new(key, ..., hashlib.sha256) and hmac.compare_digest.

Use the raw body. 360Learning's own Node sample builds the signed content from JSON.stringify(req.body). That reproduces the signed bytes only when the parsed-and-re-serialised JSON is byte-identical to what was sent; any whitespace, key order, number format or \u escape difference breaks it. The examples verify express.raw(), request.arrayBuffer() and await request.body() bytes instead. Their sample's crypto.timingSafeEqual call also throws on a signature of a different length; check lengths first.

For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.

360Learning recommends also rejecting a webhook-timestamp more than about 5 minutes from your clock. The examples make that optional (THREE_SIXTY_LEARNING_WEBHOOK_TOLERANCE_SECONDS) and dedupe on webhook-id. See references/verification.md.

One Secret per Subscription

A subscription is one event type plus one URL, and every subscription has its own secret. To receive several event types at one route, create one subscription per type and configure every secret: the examples accept a comma-separated list in THREE_SIXTY_LEARNING_WEBHOOK_SECRET and pass if any secret matches. Hookdeck's 360Learning source type (THREE_SIXTY_LEARNING) verifies with one secret, pasted with or without whsec_, so use one Hookdeck source per subscription.

Payload

Most events share one envelope; timestamp is in milliseconds:

{
  "type": "user.created",
  "timestamp": 1749816650724,
  "data": {
    "userId": "684c154ab06eb32565e5cbc0",
    "createdAt": "2025-06-13T12:10:50.568Z",
    "firstName": "Ada",
    "lastName": "Lovelace",
    "mail": "[email protected]"
  }
}

The xapi and xapi.started subscriptions are different: the body is an xAPI statement (id, actor, verb, object, context, timestamp) with no type field. Dispatch on type, and treat a body with verb and actor as a statement.

Common Event Types

Event Fired when Key data fields
user.created A user is created as active userId, mail, firstName, lastName, `createdA
Полный SKILL.md на GitHub

Установить 360learning-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/360learning/route.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл 360learning-webhooks?

Receive and verify 360Learning webhooks (learning platform, delivered through Svix). Use when creating 360Learning webhook subscriptions, debugging webhook-signature verification (webhook-id, webhook-timestamp, base64-decoded signing secret from Settings > Webhooks or GET /api/v2/webhooks/subscriptions/{id}/secrets), handling secret rotation, or reacting to events like user.created, course.attempt.closed, path.session.user.status.updated, user.certificate.awarded and xAPI statements.

Как установить скилл 360learning-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл 360learning-webhooks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить 360learning-webhooks с