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

Function getApiKeyType

packages/cli/src/utils/getApiKeyType.ts:34–65  ·  view source on GitHub ↗
(apiKey: string)

Source from the content-addressed store, hash-verified

32}
33
34export function getApiKeyType(apiKey: string): ApiKeyType | undefined {
35 if (apiKey.startsWith("tr_dev_")) {
36 return {
37 environment: "dev",
38 type: "server",
39 };
40 }
41
42 if (apiKey.startsWith("pk_dev_")) {
43 return {
44 environment: "dev",
45 type: "public",
46 };
47 }
48
49 // If they enter a prod key (tr_prod_), let them know
50 if (apiKey.startsWith("tr_prod_")) {
51 return {
52 environment: "prod",
53 type: "server",
54 };
55 }
56
57 if (apiKey.startsWith("pk_prod_")) {
58 return {
59 environment: "prod",
60 type: "public",
61 };
62 }
63
64 return;
65}

Callers 1

checkApiKeyIsDevServerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…