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

Method whoami

packages/cli/src/utils/triggerApi.ts:106–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104 }
105
106 async whoami(): Promise<WhoamiResponse | undefined> {
107 const response = await fetch(`${this.baseUrl}/api/v1/whoami`, {
108 method: "GET",
109 headers: {
110 Accept: "application/json",
111 Authorization: `Bearer ${this.apiKey}`,
112 },
113 });
114
115 if (response.ok) {
116 const body = await response.json();
117
118 const parsed = WhoamiResponseSchema.safeParse(body);
119
120 if (parsed.success) {
121 return parsed.data;
122 }
123 }
124
125 return;
126 }
127
128 async sendEvent(id: string, name: string, payload: any) {
129 const response = await fetch(`${this.baseUrl}/api/v1/events`, {

Callers 3

whoamiCommandFunction · 0.95
initCommandFunction · 0.95
startIndexingFunction · 0.80

Calls 2

jsonMethod · 0.80
fetchFunction · 0.70

Tested by

no test coverage detected