toggl-webhook
v1.0.2
Published
Wrapper for toggl webhook api v1
Downloads
5
Readme
toggl-webhook
This module provides a wrapper for the toggl track webhook api.
Install
npm install --save toggl-webhook
Warning: This package is native ESM and does not provide a CommonJS export. If your project uses CommonJS, you'll have to convert to ESM or use the dynamic import() function. Please don't open issues for questions regarding CommonJS / ESM.
Usage
import { TogglWebhookClient } from 'toggl-webhook';
const client = new TogglWebhookClient({
apiToken: 'XXX',
userAgent: '[email protected]'
});
const subscription = await client.createSubscription({
workspace_id: 10000,
url_callback: 'https://example.com/hook',
event_filters: [{entity: 'project', action: 'create'}],
description: 'unique subscription description',
secret: 'shhhh',
enabled: true
});
API docs
See the API docs.
Recieve and validate webhook events with express
toggl-webhook-express provides a middleware to validate incoming toggl webhook requests.