MCPcopy
hub / github.com/CopilotKit/CopilotKit / provideCopilotKit

Function provideCopilotKit

packages/angular/src/lib/config.ts:106–133  ·  view source on GitHub ↗
(config: CopilotKitConfig)

Source from the content-addressed store, hash-verified

104}
105
106export function provideCopilotKit(config: CopilotKitConfig): Provider {
107 const resolvedLicense = resolveLicense(config);
108 const headers = config.headers ?? {};
109 if (
110 LICENSE_WATERMARK_ENABLED &&
111 !resolvedLicense.valid &&
112 resolvedLicense.warning
113 ) {
114 logLicenseWatermarkWarning(resolvedLicense.warning);
115 }
116
117 const mergedHeaders = headers[COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]
118 ? headers
119 : !resolvedLicense.valid || !resolvedLicense.key
120 ? headers
121 : {
122 ...headers,
123 [COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: resolvedLicense.key,
124 };
125
126 return {
127 provide: COPILOT_KIT_CONFIG,
128 useValue: {
129 ...config,
130 headers: mergedHeaders,
131 },
132 };
133}

Calls 2

resolveLicenseFunction · 0.85

Tested by 2

setupFunction · 0.72
setupAgentPrecedenceFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…