Open History to see the last commit
1import { defineByokProvider } from '@tanstack/ai/byok'
2
3/** The account id that goes with {@link cloudflareByok}. */
4export const cloudflareAccountByok = defineByokProvider({
5 id: 'cloudflare-account',
6 label: 'Cloudflare account ID',
7 env: 'CLOUDFLARE_ACCOUNT_ID',
8})
9
10/**
11 * BYOK descriptor for a user-supplied Cloudflare API token. A user who brings
12 * a token brings the account it belongs to, so {@link cloudflareAccountByok}
13 * rides along: register both with `defineByok({ providers })` and a send for
14 * `cloudflare` carries both headers.
15 */
16export const cloudflareByok = defineByokProvider({
17 id: 'cloudflare',
18 label: 'Cloudflare API token',
19 env: 'CLOUDFLARE_API_TOKEN',
20 with: [cloudflareAccountByok],
21})