Official JavaScript/TypeScript SDK for HookPulse - Enterprise-grade serverless task scheduling and webhook orchestration
npm install hookpulse


Official JavaScript/TypeScript SDK for HookPulse - the enterprise-grade serverless task scheduling and webhook orchestration platform. Built with Elixir/OTP for 99.9% uptime.
``bash`
npm install hookpulseor
yarn add hookpulseor
pnpm add hookpulse
`typescript
import { HookPulseClient } from 'hookpulse';
// Initialize the client
const client = new HookPulseClient({
apiKey: 'your-api-key',
brandUuid: 'your-brand-uuid'
});
// Create an interval schedule (every hour)
const schedule = await client.createSchedule({
webhookUrl: 'https://example.com/webhook',
scheduleType: 'interval',
intervalSeconds: 3600
});
// Create a cron schedule (daily at 9 AM)
const schedule = await client.createSchedule({
webhookUrl: 'https://example.com/webhook',
scheduleType: 'cron',
cronExpression: '0 9 *',
timezone: 'America/New_York'
});
`
By default, the SDK uses https://api.hookpulse.io as the base URL. You can change this if needed:
`typescript`
const client = new HookPulseClient({
apiKey: 'your-api-key',
brandUuid: 'your-brand-uuid',
baseUrl: 'https://custom-api.example.com', // Optional
timeout: 60000 // Optional, default: 30000ms
});
The SDK requires two authentication headers:
- x-hookpulse-api-key: Your API key (get from dashboard → API Keys)x-brand-uuid
- : Your brand UUID (get from dashboard after adding a brand)
Both are automatically included in all requests.
#### Interval Schedules
`typescript`
// Schedule every 5 minutes
await client.createSchedule({
webhookUrl: 'https://example.com/webhook',
scheduleType: 'interval',
intervalSeconds: 300
});
#### Cron Schedules
`typescript`
// Daily at 9 AM
await client.createSchedule({
webhookUrl: 'https://example.com/webhook',
scheduleType: 'cron',
cronExpression: '0 9 *',
timezone: 'America/New_York'
});
#### Clocked Schedules (One-time)
`typescript`
// Schedule for a specific date/time
await client.createSchedule({
webhookUrl: 'https://example.com/webhook',
scheduleType: 'clocked',
scheduledTime: '2024-12-25T09:00:00Z',
timezone: 'UTC'
});
`typescript
// Create a webhook template
const template = await client.createWebhookTemplate(
'Payment Notification',
'https://api.example.com/payments',
'POST',
{ 'Authorization': 'Bearer {{ #api_key }}' },
{ amount: '{{ amount }}', currency: 'USD' }
);
// Get all templates
const templates = await client.getWebhookTemplates(1);
// Update a template
await client.updateWebhookTemplate(template.data.uuid, {
name: 'Updated Payment Notification'
});
`
`typescript`
// Create a workflow template
const workflow = await client.createWorkflowTemplate(
'Payment Processing',
[
{
name: 'Validate Payment',
type: 'webhook',
url: 'https://api.example.com/validate',
method: 'POST'
}
],
'fifo'
);
`typescript
// Get all schedules
const schedules = await client.getSchedules(1, 'active');
// Get a specific schedule
const schedule = await client.getSchedule('uuid-here');
// Pause a schedule
await client.updateScheduleStatus('uuid-here', 'paused');
// Resume a schedule
await client.updateScheduleStatus('uuid-here', 'active');
// Delete a schedule
await client.deleteSchedule('uuid-here');
`
`typescript
import {
HookPulseClient,
HookPulseError,
HookPulseAPIError,
HookPulseAuthError
} from 'hookpulse';
try {
const client = new HookPulseClient({
apiKey: 'invalid',
brandUuid: 'invalid'
});
await client.createSchedule({...});
} catch (error) {
if (error instanceof HookPulseAuthError) {
console.error('Authentication failed:', error.message);
} else if (error instanceof HookPulseAPIError) {
console.error(API error (${error.statusCode}):, error.message);`
} else if (error instanceof HookPulseError) {
console.error('Error:', error.message);
}
}
This package includes full TypeScript definitions. No additional @types` package needed.
- Full API Documentation
- HookPulse Website
- Node.js >= 14.0.0
- TypeScript >= 5.0.0 (optional, for TypeScript projects)
MIT License - see LICENSE file for details
- Email: care@hookpulse.io
- Documentation: https://docs.hookpulse.io/docs
- Issues: Report an issue for the JavaScript/TypeScript SDK
- Source: hookpulse-js/
Contributions are welcome! Please feel free to submit a Pull Request.