MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / getApiKey

Function getApiKey

packages/trigger-sdk/src/apiClient.ts:742–757  ·  view source on GitHub ↗
(key?: string)

Source from the content-addressed store, hash-verified

740}
741
742function getApiKey(key?: string) {
743 const apiKey = key ?? env.TRIGGER_API_KEY;
744
745 if (!apiKey) {
746 return { status: "missing" as const };
747 }
748
749 // Validate the api_key format (should be tr_{env}_XXXXX)
750 const isValid = apiKey.match(/^tr_[a-z]+_[a-zA-Z0-9]+$/);
751
752 if (!isValid) {
753 return { status: "invalid" as const, apiKey };
754 }
755
756 return { status: "valid" as const, apiKey };
757}
758
759type VersionedResponseBodyMap = {
760 [key: string]: z.ZodTypeAny;

Callers 1

#apiKeyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…