Node.js
Use Event's Node SDK to send server-side events to various destinations.
Event'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 Event dashboard (seen above) has the SDK installation snippet containing the secret key. Copy it to integrate the Node SDK into your application.
npm install @event-inc/emit
Run the following snippet to initialize the Node SDK. It creates a global Event client object that can be used for all the subsequent event requests.
import { createClient } from "@event-inc/emit";
// Init your Web SDK
const client = createClient(process.env.EVENT_INC_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 "@event-inc/emit";
// Init your Web SDK
const client = createClient(process.env.EVENT_INC_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://stream.event.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 1mo ago