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

Function TriggerProvider

packages/react/src/TriggerProvider.tsx:34–54  ·  view source on GitHub ↗
({ publicApiKey, apiUrl, children }: TriggerProviderProps)

Source from the content-addressed store, hash-verified

32};
33
34export function TriggerProvider({ publicApiKey, apiUrl, children }: TriggerProviderProps) {
35 const [queryClient] = useState(() => new QueryClient());
36
37 if (!publicApiKey) {
38 throw new Error("TriggerProvider requires `publicApiKey` to be set with a value.");
39 }
40
41 verifyApiKey(publicApiKey);
42
43 return (
44 <ProviderContext.Provider
45 value={{
46 publicApiKey,
47 apiUrl: apiUrl ?? "https://api.trigger.dev",
48 queryClient,
49 }}
50 >
51 {children}
52 </ProviderContext.Provider>
53 );
54}
55
56function verifyApiKey(apiKey: string) {
57 if (apiKey.startsWith(privateApiKeyStartsWith)) {

Callers

nothing calls this directly

Calls 1

verifyApiKeyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…