Node.js
Use Buildable's Node SDK to send server-side events to various destinations.
Buildable's Node SDK lets you track and send the events from your Node applications to the specified destinations.
- 1.
- 2.Connect a Node.js Source from the dashboard. You should be able to see the secret key for this source, as shown:

The Setup tab in the Buildable dashboard (seen above) has the SDK installation snippet containing the secret key. Copy it to integrate the Node SDK into your application.
npm install @buildable/client
Run the following snippet to initialize the Node SDK. It creates a global Buildable client object that can be used for all the subsequent event requests.
import { createClient } from "@buildable/client";
// Init your Web SDK
const client = createClient(process.env.BUILDABLE_SECRET_KEY);
The
emit
call lets you create and package an event with a name and a payload.A sample
emit
call is as shown:import { createClient } from "@buildable/client";
// Init your Web SDK
const client = createClient(process.env.BUILDABLE_SECRET_KEY);
// Emit Message
client.emit("user.created", user);
The
emit
parameters are described below:Field | Required | Type | Description |
---|---|---|---|
Event | string | The name of the event | |
Payload | string | The data associated with the event |
Alternatively, you can emit using cURL:
# Using cURL
curl --location --request POST 'https://events.buildable.dev/emit' \
--header 'X-Buildable-Secret: <YOUR SECRET KEY 🤫>' \
--header 'Content-Type: application/json' \
--data-raw '{
"event": "user.created",
"payload": {
"name": "John Doe"
}
}'
Last modified 9d ago