Skip to content

Setup

You need:

Install @alchemy.run/e2b:

Terminal window
pnpm add https://pkg.alchemy.run/@alchemy.run/e2b/pr:3743:41147c9

Then add E2B.providers() next to your cloud’s providers:

alchemy.run.ts
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 {};
}),
);
Terminal window
pnpm alchemy profile edit --add E2B

Pick 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.

Set E2B_ACCESS_TOKEN, and Alchemy uses it instead of your profile:

Terminal window
E2B_ACCESS_TOKEN=sk_e2b_... pnpm alchemy deploy

E2B_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.