Documentation Index
Fetch the complete documentation index at: https://www.helius.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
This guide will walk you through setting up your first event listener with Helius.
Prerequisites
- A Helius API key (Get one from the Helius Dashboard)
- A webhook endpoint that can receive POST requests (for webhook listeners)
Setup Options
Helius offers two primary methods for event listening:
- Webhooks - Receive notifications when specific blockchain events occur
- WebSockets - Real-time event streaming for responsive applications
Quick Setup: Webhooks
Create a Webhook
curl -X POST 'https://api-mainnet.helius-rpc.com/v0/webhooks' \
-H 'Content-Type: application/json' \
-d '{
"accountAddresses": ["YOUR_ACCOUNT_ADDRESS"],
"transactionTypes": ["ANY"],
"webhookURL": "YOUR_WEBHOOK_URL",
"authHeader": {"key": "value"}, // optional
"webhookType": "enhanced"
}' \
-H 'Authorization: Bearer YOUR_API_KEY'
Verify Receipt
Events matching your criteria will be sent to your webhook URL as POST requests. The payload will include:{
"accountData": [],
"description": "",
"events": {},
"fee": 5000,
"feePayer": "YOUR_ACCOUNT_ADDRESS",
"signature": "TRANSACTION_SIGNATURE",
"slot": 1234567,
"timestamp": 1234567890000,
"type": "TRANSACTION_TYPE"
}
Quick Setup: WebSockets
Connect to WebSocket Endpoint
const WebSocket = require('ws');
// Connect to Helius WebSocket endpoint
const ws = new WebSocket('wss://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY');
Set Up Event Handlers
// Handle connection open
ws.on('open', () => {
console.log('Connected to Helius WebSocket');
});
// Handle incoming messages
ws.on('message', (data) => {
const event = JSON.parse(data);
console.log('Received event:', event);
});
Next Steps
For additional help, join our Discord or Telegram communities.