https://github.com/pixtron/toggl-webhook
node.js wrapper for toggl webhook api v1
https://github.com/pixtron/toggl-webhook
api node toggl webhook
Last synced: about 1 month ago
JSON representation
node.js wrapper for toggl webhook api v1
- Host: GitHub
- URL: https://github.com/pixtron/toggl-webhook
- Owner: pixtron
- License: mit
- Created: 2022-06-26T13:22:07.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-27T15:39:00.000Z (almost 4 years ago)
- Last Synced: 2025-10-05T22:31:08.632Z (9 months ago)
- Topics: api, node, toggl, webhook
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/toggl-webhook
- Size: 216 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# toggl-webhook
This module provides a wrapper for the [toggl track webhook api](https://developers.track.toggl.com/docs/webhooks_start).
## Install
```
npm install --save toggl-webhook
```
*Warning*: This package is native [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) and does not provide a CommonJS export. If your project uses CommonJS, you'll have to [convert to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) or use the dynamic import() function. Please don't open issues for questions regarding CommonJS / ESM.
## Usage
```ts
import { TogglWebhookClient } from 'toggl-webhook';
const client = new TogglWebhookClient({
apiToken: 'XXX',
userAgent: 'bob@example.com'
});
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](https://pixtron.github.io/toggl-webhook/).
## Recieve and validate webhook events with express
[toggl-webhook-express](https://www.npmjs.com/package/toggl-webhook-express) provides a middleware to validate incoming toggl webhook requests.