Skip to content

Commit d0e6442

Browse files
committed
Add additional sendEvent exampels
1 parent 1e374d3 commit d0e6442

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/sdk/triggerclient/instancemethods/sendevent.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,29 @@ const event = client.sendEvent({
2727
});
2828
```
2929

30+
```ts Send an event with an ID
31+
const event = client.sendEvent({
32+
id: "e_1234567890", // You can use this to deduplicate events
33+
name: "new.user",
34+
payload: {
35+
userId: "u_1234567890",
36+
},
37+
});
38+
```
39+
40+
```ts Send an event to be delivered later
41+
const event = client.sendEvent(
42+
{
43+
id: "e_1234567890", // You can use this to deduplicate events
44+
name: "new.user",
45+
payload: {
46+
userId: "u_1234567890",
47+
},
48+
},
49+
{
50+
deliverAt: new Date("2023-12-01T00:00:00.000Z"),
51+
}
52+
);
53+
```
54+
3055
</RequestExample>

0 commit comments

Comments
 (0)