Skip to main content
This guide walks you through setting up Posthook, connecting your local environment, and sending your first scheduled hook.
Prefer an interactive guide? You can follow this same walkthrough interactively in the Posthook Dashboard.

1. Log In

Connect your local development server to Posthook using the CLI. This lets you receive webhooks locally without tunneling tools like ngrok.
npx posthook login
You will be prompted to enter your API Secret Key. You can find this in the Settings page of your project in the Dashboard.

2. Start the Listener

Start the Posthook listener to forward webhooks to your local application.
npx posthook listen --forward http://localhost:3000
Replace http://localhost:3000 with the base URL of your local server.
The listener connects to Posthook via WebSocket. It receives webhooks and forwards them to your specified local URL.

3. Install the SDK (Optional)

Install an official SDK for a streamlined experience. You can also use curl directly.
npm install @posthook/node

4. Send a Test Hook

In a new terminal, schedule a test webhook to fire in 5 seconds.
import Posthook from '@posthook/node';
const posthook = new Posthook('phk_your_api_key');

const hook = await posthook.hooks.schedule({
  path: '/webhooks/posthook/send-reminder',
  postIn: '5s',
  data: {
    user_id: 'usr_123',
    reminder_id: 'rem_456'
  }
});

console.log('Scheduled:', hook.id);
You can find your API Key in the Settings page of your project in the Dashboard.

Verification

Check your posthook listen terminal. You should see the hook arrive when it fires:
2026-01-01 12:00:00 [200 OK] POST /webhooks/posthook/send-reminder

5. Check the Dashboard

Open the Activity page in the Dashboard. You can inspect the full payload, view delivery timing, and check response details for any hook.

Next Steps