Webhooks Module
Manage webhook endpoints for event notifications
Webhooks Module
The webhooks module provides functionality for registering and managing webhook endpoints to receive real-time notifications for wallet events.
Import
import {
create,
findAll,
findOne,
update,
remove
} from 'cilantro-sdk/webhooks';
Operations
create(options)
Register a new webhook endpoint.
urlstringrequiredWebhook endpoint URL
eventsstring[]requiredArray of event types to subscribe to
descriptionstringDescription of the webhook
isActivebooleanWhether the webhook is active (default: true)
const webhook = await create({
url: 'https://your-domain.com/webhooks/cilantro',
events: ['wallet.created', 'transaction.confirmed', 'transaction.failed'],
description: 'Production webhook for transaction events',
isActive: true
});
findAll()
List all webhooks for your platform.
const webhooks = await findAll();
console.log('Registered webhooks:', webhooks);
findOne(webhookId)
Get webhook by ID.
const webhook = await findOne('webhook-id');
update(webhookId, options)
Update webhook configuration.
await update('webhook-id', {
events: ['wallet.created', 'transaction.confirmed'],
isActive: false // Temporarily disable
});
remove(webhookId)
Delete a webhook.
await remove('webhook-id');
Available Events
wallet.created- Wallet was createdwallet.updated- Wallet was updatedwallet.deleted- Wallet was deletedtransaction.confirmed- Transaction was confirmedtransaction.failed- Transaction failedsigner.created- Signer was createdsigner.updated- Signer was updatedsigner.deleted- Signer was deleted