Ingestion SDKs
Official client libraries for sending webhooks with Nahook
Nahook provides official SDKs for 8 languages. Each SDK handles authentication, routing, retries, and idempotency out of the box.
SDKs automatically route requests to the correct endpoint based on your API key prefix — no configuration needed.
Node.js
npm install @nahook/clientimport { NahookClient } from "@nahook/client";
const nahook = new NahookClient("nhk_us_YOUR_API_KEY");
// Send directly to an endpoint
await nahook.send("ep_your_endpoint_id", {
payload: { event: "user.created", userId: "usr_123" },
});
// Or fan-out by event type to all subscribed endpoints
await nahook.trigger("user.created", {
payload: { userId: "usr_123" },
});The Node SDK is split into two packages: @nahook/client for sending webhooks (this page), and @nahook/management for managing endpoints, API keys, and other resources programmatically — see the Management API.
nahook-node
GitHub repository
Python
pip install nahookfrom nahook import NahookClient
client = NahookClient("nhk_us_YOUR_API_KEY")
# Send directly to an endpoint
client.send("ep_your_endpoint_id", {
"event": "user.created",
"user_id": "usr_123",
})
# Or fan-out by event type to all subscribed endpoints
client.trigger("user.created", {
"user_id": "usr_123",
})nahook-python
GitHub repository
Go
go get github.com/getnahook/nahook-goimport (
"context"
nahookclient "github.com/getnahook/nahook-go/client"
nahook "github.com/getnahook/nahook-go"
)
client, _ := nahookclient.New("nhk_us_YOUR_API_KEY")
// Send directly to an endpoint
client.Send(context.Background(), "ep_your_endpoint_id", nahook.SendOptions{
Payload: map[string]any{"event": "user.created", "userId": "usr_123"},
})
// Or fan-out by event type to all subscribed endpoints
client.Trigger(context.Background(), "user.created", nahook.TriggerOptions{
Payload: map[string]any{"userId": "usr_123"},
})nahook-go
GitHub repository
Java
<dependency>
<groupId>com.nahook</groupId>
<artifactId>nahook-java</artifactId>
<version>0.2.0</version>
</dependency>implementation "com.nahook:nahook-java:0.2.0"import com.nahook.NahookClient;
import com.nahook.types.SendOptions;
import com.nahook.types.TriggerOptions;
import java.util.Map;
var client = new NahookClient("nhk_us_YOUR_API_KEY");
// Send directly to an endpoint
client.send("ep_your_endpoint_id", new SendOptions(Map.of(
"event", "user.created",
"userId", "usr_123"
)));
// Or fan-out by event type to all subscribed endpoints
client.trigger("user.created", new TriggerOptions(Map.of("userId", "usr_123")));nahook-java
GitHub repository
C# / .NET
dotnet add package Nahookusing Nahook;
var client = new NahookClient("nhk_us_YOUR_API_KEY");
// Send directly to an endpoint
await client.SendAsync("ep_your_endpoint_id", new SendOptions {
Payload = new Dictionary<string, object> { ["event"] = "user.created" }
});
// Or fan-out by event type to all subscribed endpoints
await client.TriggerAsync("user.created", new TriggerOptions {
Payload = new Dictionary<string, object> { ["userId"] = "usr_123" }
});nahook-dotnet
GitHub repository
PHP
composer require nahook/nahook-phpuse Nahook\NahookClient;
$client = new NahookClient("nhk_us_YOUR_API_KEY");
// Send directly to an endpoint
$client->send("ep_your_endpoint_id", [
"payload" => [
"event" => "user.created",
"user_id" => "usr_123",
],
]);
// Or fan-out by event type to all subscribed endpoints
$client->trigger("user.created", [
"payload" => ["user_id" => "usr_123"],
]);nahook-php
GitHub repository
Ruby
gem install nahookrequire "nahook"
client = Nahook::Client.new("nhk_us_YOUR_API_KEY")
# Send directly to an endpoint
client.send("ep_your_endpoint_id", payload: {
event: "user.created",
user_id: "usr_123",
})
# Or fan-out by event type to all subscribed endpoints
client.trigger("user.created", payload: {
user_id: "usr_123",
})nahook-ruby
GitHub repository
Rust
cargo add nahookuse nahook::{NahookClient, SendOptions, TriggerOptions};
let client = NahookClient::new("nhk_us_YOUR_API_KEY")?;
// Send directly to an endpoint
client.send("ep_your_endpoint_id", SendOptions {
payload: serde_json::json!({"event": "user.created", "userId": "usr_123"}),
idempotency_key: None,
}).await?;
// Or fan-out by event type to all subscribed endpoints
client.trigger("user.created", TriggerOptions {
payload: serde_json::json!({"userId": "usr_123"}),
metadata: None,
}).await?;nahook-rust
GitHub repository
Verifying Webhooks
Nahook signs every outgoing delivery using the Standard Webhooks specification (HMAC-SHA256). To verify incoming webhooks on the receiving side, use the official standardwebhooks package for your language — no Nahook-specific library needed.
npm install standardwebhooks # Node.js
pip install standardwebhooks # Pythonimport { Webhook } from "standardwebhooks";
const wh = new Webhook("whsec_your_signing_secret");
const payload = wh.verify(body, headers);For full details on signature headers, timestamp validation, and language-specific examples, see the Webhook Signatures guide.