@buildable/events
v1.0.5
Published
Custom Events for Buildable
Downloads
7
Readme
@buildable/events
A NodeJS SDK for handling Events
with Buildable workflows.
Emit
NodeJS
// require
const { createClient } = require('@buildable/events')
const client = createClient(process.env.MY_BUILDABLE_SECRET)
// ...
const successful = client.emit('EVENT-NAME', { myEssentialValue: 'Buildable rocks' });
Using Curl
curl --location --request POST 'https://development-events.buildable.io/emit' \
--header 'X-Buildable-Secret: <YOUR SECRET 🤫>' \
--header 'Content-Type: application/json' \
--data-raw '{
<ANY KEY>: <ANY VALUE>,
...
}'
Listen
// import
const { createClient } = require('@buildable/events');
const client = createClient(process.env.MY_BUILDABLE_SECRET)
// ...
client.on('EVENT-NAME', (event) => {
//do stuff
})