(provider: ApiKeyPluginConfig)
| 7 | } |
| 8 | |
| 9 | export function pluginApiKey(provider: ApiKeyPluginConfig): ZodiosPlugin { |
| 10 | return { |
| 11 | request: async (_, config) => { |
| 12 | return { |
| 13 | ...config, |
| 14 | headers: { |
| 15 | ...config.headers, |
| 16 | "api-key": await provider.getApiKey(), |
| 17 | }, |
| 18 | }; |
| 19 | }, |
| 20 | }; |
| 21 | } |