INNER CODE UNIT · TypeScript

getCloudflareCredentials

Jazee6/cloudflare-ai-web · app/api/index.ts:20

export const getCloudflareCredentials = () => ({
  accountId: requireEnvironmentVariable("CF_ACCOUNT_ID"),
  apiKey: requireEnvironmentVariable("CF_WORKERS_AI_TOKEN"),
});

export const getCloudflareGatewayCredentials = () => {
  const gatewayId = process.env.CF_AI_GATEWAY_NAME;
  if (!gatewayId) {
    return undefined;
  }

  return {
    gatewayId,
    gatewayToken: requireEnvironmentVariable("CF_AI_GATEWAY_TOKEN"),
  };
};

export const getWorkersAIProvider = () => {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…