Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

nansen-alerts-webhook-listener

FreeNo executable scriptsNot checked

Set up a local webhook server to receive Nansen smart alerts in real-time with HMAC signature verification and public tunneling. Use when a user wants to…

nansen-aiby nansen-ai★ 151 GitHub stars1,209 installs in other catalogs

About this skill

Authentication

Nansen account API calls accept a selected nansen:api browser session or conventional API key with the same permissions. NANSEN_API_KEY takes precedence; optional primaryEnv preserves configured-key injection. Run nansen auth status for offline selection. Cached access expiry alone permits automatic renewal during an authorized task. Stop on anonymous selection, invalid state, blocked/uncertain renewal or actual auth failure; never drop a credential or fall back to anonymous x402 payment. Browser login does not grant wallet signing, privileged service identity or a persistent MCP integration key. Preserve all confirmation, signing, sanctions and geographic checks below. Browser login is enabled in production within the documented platform scope.

Alert Webhook Listener

Set up a local HTTP server to receive Nansen smart alert webhook payloads in real-time.

How It Works

Nansen smart alerts support a webhook channel type. When an alert fires, Nansen sends an HTTP POST with a JSON payload to your webhook URL. This skill sets up:

  1. A local HTTP server (Node.js, zero external dependencies) that receives and displays alert payloads
  2. HMAC-SHA256 signature verification so only authentic Nansen payloads are accepted
  3. A public tunnel so Nansen's servers can reach your local machine

This skill does NOT create or modify alerts. It sets up the listener infrastructure and then provides a summary of what the user needs to do to start receiving alerts.

OpenClaw users: If OpenClaw is running locally on the same machine, the webhook server can forward verified alert payloads to OpenClaw's Gateway (/hooks/agent), triggering an agent turn for each alert. Set the OPENCLAW_GATEWAY_URL env var to enable this. See the OpenClaw Integration section below.

Security Warning

Before proceeding, inform the user:

This skill starts an HTTP server on your machine and exposes it to the internet via a tunnel (ngrok or localtunnel). While the server only binds to localhost (127.0.0.1) — meaning no one on your local network can access it directly — the tunnel creates a public URL that anyone on the internet can send requests to.

Mitigations in place:

  • HMAC-SHA256 signature verification rejects all requests not signed by Nansen
  • 1 MB body size limit prevents memory abuse
  • Only POST /webhook and GET /health are accepted; everything else returns 404

You should be aware that:

  • The tunnel URL is publicly discoverable (ngrok URLs can be enumerated)
  • Unsigned requests still reach your machine — they're rejected, but the connection is made
  • Stop the tunnel when you're done to close the public endpoint

Wait for the user to confirm they want to proceed before continuing.

Execution Plan

Follow these steps in order. Do not skip signature verification — it is mandatory.

Step 0: Choose a tunnel provider

Before starting, ask the user which tunnel provider they want to use:

ngrok (recommended) localtunnel
Stability Stable — persistent connections with keepalive Flaky — free relay drops idle connections without warning, tunnels die randomly
Install brew install ngrok + free account at ngrok.com Zero install (npx localtunnel)
HTTPS Yes Yes
Auth required Yes (free authtoken from ngrok.com) No

Recommend ngrok. localtunnel is convenient but unreliable — in testing, tunnels silently exit after minutes, causing alerts to fail with "503 Tunnel Unavailable". ngrok maintains stable connections.

Check if ngrok is available:

which ngrok && ngrok version

If not installed, tell the user:

  1. brew install ngrok (or download from ngrok.com)
  2. Create a free account at ngrok.com and copy the authtoken
  3. ngrok config add-authtoken <token>

If the user prefers localtunnel or can't install ngrok, proceed with localtunnel but warn them that the tunnel may drop and they'll need to restart it and update their alert's webhook URL.

Step 1: Generate a webhook secret

Write the secret straight to a file that only the user can read, so it never appears in the terminal, the shell history or the transcript:

(umask 077 && node -e "process.stdout.write(require('crypto').randomBytes(32).toString('hex'))" > nansen-webhook-secret.txt)

The server and the alert both read it from this file (WEBHOOK_SECRET="$(cat nansen-webhook-secret.txt)" for the server, --webhook-secret-stdin < nansen-webhook-secret.txt for nansen alerts). Never log, echo or paste the secret.

Step 2: Write the webhook receiver script

Create nansen-webhook-server.mjs in the current working directory. Use only Node.js built-in modules (node:http, node:crypto). No npm install required.

Requirements — do not deviate:

Requirement Detail
Bind addr
Full SKILL.md on GitHub

Install nansen-alerts-webhook-listener in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

Bash(nansen:*)
Bash(node:*)
Bash(npx:*)
Bash(ngrok:*)
Write

FAQ

What does the nansen-alerts-webhook-listener skill do?

Set up a local webhook server to receive Nansen smart alerts in real-time with HMAC signature verification and public tunneling. Use when a user wants to listen for alerts on their local machine.

How do I install the nansen-alerts-webhook-listener skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the nansen-alerts-webhook-listener skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare nansen-alerts-webhook-listener with