@dispatchedjs/cli
v1.6.0
Published
Dispatched - CLI
Readme
DispatchedJs - CLI
This is a TypeScript helper library for node.js server side to integrate Dispatched into your application.
Usage
When developing locally, you can use the Dispatched CLI to start a local server that will receive webhook callbacks.
- Install the CLI globally:
npm install -g @dispatchedjs/cli- Start the local server:
dispatchedjs listen --secret="any-webhook-secret-for-local-dev" --forward="http://localhost:3000/path/to/webhook/endpoint" --port=3000Options:
--secretis the secret you want to use to verify the webhook requests. For security reasons, it is recommended to use a different secret than the one you use in production (you can use something simple like "abc123" for local development).--forwardis the URL that Dispatched will send the webhook requests to.--portis the port you want the server to listen on. It defaults to 3100.--scheduledDelayis the number of seconds to add to the current time when a future job is created before dispatching it. Defaults to 30 seconds. This means jobs will be dispatched at (current time + delay), which mocks future webhook delivery for development purposes. Avoids having to wait long for jobs scheduled far in the future.
NOTE: Scheduled jobs will be processed with the configured delay when using the local server.
License
MIT
