const event = client.sendEvent({
  name: "new.user",
  payload: {
    userId: "u_1234567890",
  },
});

These are the docs for Trigger.dev v2 which will be deprecated on January 31st, 2025. You probably want the v3 docs.

You can call this function from anywhere in your backend to send an event. The other way to send an event is by using io.sendEvent() from inside a run() function.

Use eventTrigger() on a Job to listen for events.

For multiple events, use client.sendEvents() instead.

Parameters

event
object
required
options
object

Returns

const event = client.sendEvent({
  name: "new.user",
  payload: {
    userId: "u_1234567890",
  },
});