Setup
You need:
Add the provider
Section titled “Add the provider”Install @alchemy.run/e2b:
pnpm add https://pkg.alchemy.run/@alchemy.run/e2b/pr:3743:41147c9bun add https://pkg.alchemy.run/@alchemy.run/e2b/pr:3743:41147c9npm install https://pkg.alchemy.run/@alchemy.run/e2b/pr:3743:41147c9yarn add https://pkg.alchemy.run/@alchemy.run/e2b/pr:3743:41147c9Then add E2B.providers() next to your cloud’s providers:
import * as Cloudflare from "@alchemy.run/cloudflare";import * as E2B from "@alchemy.run/e2b";import * as Alchemy from "alchemy";import * as Effect from "effect/Effect";import * as Layer from "effect/Layer";
export default Alchemy.Stack( "MyApp", { providers: Layer.mergeAll(Cloudflare.providers(), E2B.providers()), state: Cloudflare.state(), }, Effect.gen(function* () { return {}; }),);Sign in
Section titled “Sign in”pnpm alchemy profile edit --add E2Bbun alchemy profile edit --add E2Bnpx alchemy profile edit --add E2Byarn alchemy profile edit --add E2BPick Browser login and sign in to E2B. Alchemy deploys to your account’s default team, and the login refreshes itself. To paste an access token or an API key instead, pick Access token or API key.
E2B can’t narrow an API key, so each one reaches everything in its team. Use a separate team for tests. See Team & API keys.
Deploy from CI
Section titled “Deploy from CI”Set E2B_ACCESS_TOKEN, and Alchemy uses it instead of your profile:
E2B_ACCESS_TOKEN=sk_e2b_... pnpm alchemy deployE2B_ACCESS_TOKEN=sk_e2b_... bun alchemy deployE2B_ACCESS_TOKEN=sk_e2b_... npx alchemy deployE2B_ACCESS_TOKEN=sk_e2b_... yarn alchemy deployE2B_API_KEY is enough to deploy resources, but bindings and E2B.ApiKey create keys, which takes the access token. See Team & API keys.
Next, build the tutorial.