MCPcopy
hub / github.com/triggerdotdev/trigger.dev / sendEvent

Method sendEvent

packages/cli/src/utils/triggerApi.ts:128–145  ·  view source on GitHub ↗
(id: string, name: string, payload: any)

Source from the content-addressed store, hash-verified

126 }
127
128 async sendEvent(id: string, name: string, payload: any) {
129 const response = await fetch(`${this.baseUrl}/api/v1/events`, {
130 method: "POST",
131 headers: {
132 Accept: "application/json",
133 Authorization: `Bearer ${this.apiKey}`,
134 },
135 body: JSON.stringify({
136 event: {
137 id,
138 name,
139 payload,
140 },
141 }),
142 });
143
144 return response.ok;
145 }
146
147 async registerEndpoint(options: CreateEndpointOptions): Promise<EndpointResponse> {
148 const response = await fetch(`${this.baseUrl}/api/v1/endpoints`, {

Callers 1

sendEventCommandFunction · 0.95

Calls 1

fetchFunction · 0.70

Tested by

no test coverage detected