Skip to content
GitHubXDiscordRSS

Blog

Alchemy Profiles

Alchemy Profiles are a new way to manage your Cloudflare credentials and accounts.

Profiles also extend support for OAuth with Alchemy’s own OAuth Client ID that supports all Cloudflare permission scopes (not just the limited subset supported by wrangler).

There are three different ways to authorize with Cloudflare:

  1. OAuth (preferred)
  2. API Token
  3. Global API Key

Ideally, you’d only ever need to use OAuth because it doesn’t rely on storing long-lived credentials.

However, the OAuth Client ID used by wrangler only supports a limited subset of Cloudflare permission scopes, so you’d eventually run into API calls that just don’t work (like creating an AI Gateway). To workaround this, developers would create an API Token or (worse) risk the farm by using a Global API Key.

Many developers end up creating API tokens with all permissions because it’s easier than dealing with the friction of narrowing down permissions to precisely what’s needed. One of Alchemy’s developers, Michael Kassabov, reverse engineered a script to generate an API Token with all permissions 😅.

Alchemy used to rely on wrangler login for OAuth, but now has its own OAuth Client ID that supports all Cloudflare permission scopes. You should no longer need to create API tokens for your Infrastructure-as-Code.

If you only have one Cloudflare account, then you’re lucky - Alchemy can automatically resolve the Account ID for you.

If you have multiple accounts, then you need to manually set the Account ID as another CLOUDFLARE_ACCOUNT_ID environment variable or explicitly set the accountId when creating a Cloudflare Resource.

Alchemy's Cloudflare Vite Plugin

Alchemy now ships with plugins for Vite, Astro, SvelteKit, Nuxt, React Router, and TanStack Start that streamline local development by eliminating the need for a .dev.vars file, configuration of wrangler state paths, and other boilerplate.

What is Alchemy

Alchemy is an embeddable Infrastructure-as-Code library written in pure TypeScript that runs anywhere JavaScript runs. Learn how it differs from traditional IaC tools.

Why IaC needs to be un-bundled

After a decade of wrestling with CloudFormation, CDK, Pulumi, and Terraform, I built my own minimal IaC library in pure TypeScript. Here’s why I think it’s time to “un-bundle” Infrastructure-as-Code and return to simplicity.