### Start Local Service Example Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tunnel.mdx Examples of starting a local HTTP server or running an application for testing the Cloudflare Tunnel. ```sh # Example: Start a simple HTTP server on port 3000 npx http-server -p 3000 # Or run your application # node app.js # python -m http.server 3000 # etc. ``` -------------------------------- ### Getting Started Guide (Markdown) Source: https://github.com/sam-goodwin/alchemy/blob/main/CLAUDE.md Defines the structure for a provider's getting started guide, located in `alchemy-web/docs/guides/{provider}.md`. This file acts as a tutorial, providing a concise overview and setup instructions for users new to the provider. ```markdown --- order: { number to decide the position in the tree view } title: { Provider } description: { concise description of the tutorial } --- # Getting Started {Provider} {1 sentence overview of what this tutorial will set the user up with} ``` -------------------------------- ### Project Setup and Execution Source: https://github.com/sam-goodwin/alchemy/blob/main/examples/cloudflare-livestore/README.md Commands to install dependencies and run the Cloudflare Livestore example locally or deploy it to Cloudflare. ```bash bun install bun dev # run locally bun run deploy # or deploy to Cloudflare ``` -------------------------------- ### Create Project Directory Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/getting-started.mdx Initializes a new project directory for your Alchemy application. This step prepares the environment for installing dependencies and writing infrastructure code. ```sh mkdir my-alchemy-app cd my-alchemy-app ``` -------------------------------- ### Install Dependencies Source: https://github.com/sam-goodwin/alchemy/blob/main/examples/cloudflare-nuxt-pipeline/README.md Installs project dependencies using Bun. This command should be run from the root of the Alchemy repository to install all example dependencies. ```bash bun install ``` -------------------------------- ### Install Alchemy Package Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/getting-started.mdx Installs the Alchemy library into your project using various package managers. Alchemy is a TypeScript-native Infrastructure-as-Code library. ```bun bun init -y bun add alchemy ``` ```npm npm init -y npm install alchemy ``` ```pnpm pnpm init pnpm add alchemy ``` ```yarn yarn init -y yarn add alchemy ``` -------------------------------- ### Install Dependencies (Bash) Source: https://github.com/sam-goodwin/alchemy/blob/main/examples/cloudflare-sveltekit/README.md Installs project dependencies for the core library and all examples, including the Cloudflare SvelteKit example. This command should be run from the root of the Alchemy repository. ```bash bun install ``` -------------------------------- ### Install Dependencies with Bun Source: https://github.com/sam-goodwin/alchemy/blob/main/examples/cloudflare-astro/README.md Installs project dependencies using the Bun package manager. This command is essential before running other project scripts. ```bash bun install ``` -------------------------------- ### Install and Run TanStack Project Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy/templates/tanstack-start/README.md Commands to install project dependencies and start the application in development mode. This allows for automatic rebuilding of assets as files change. ```sh pnpm install pnpm dev ``` -------------------------------- ### Install cloudflared Connector Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tunnel.mdx Instructions for installing the cloudflared connector on various operating systems and Docker. ```sh brew install cloudflared ``` ```powershell winget install --id Cloudflare.cloudflared ``` ```docker docker pull cloudflare/cloudflared:latest ``` -------------------------------- ### Initialize TanStack Start Project Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tanstack-start.mdx Commands to create a new TanStack Start project using Alchemy. Supports multiple package managers (bun, npm, pnpm, yarn). Navigates into the project directory. ```sh bunx alchemy create my-tanstack-app --template=tanstack-start cd my-tanstack-app ``` ```sh npx alchemy create my-tanstack-app --template=tanstack-start cd my-tanstack-app ``` ```sh pnpm dlx alchemy create my-tanstack-app --template=tanstack-start cd my-tanstack-app ``` ```sh yarn dlx alchemy create my-tanstack-app --template=tanstack-start cd my-tanstack-app ``` -------------------------------- ### Install and Run Development Server Source: https://github.com/sam-goodwin/alchemy/blob/main/examples/cloudflare-tanstack-start/README.md Installs project dependencies using pnpm and starts the application in development mode. This process rebuilds assets automatically when files change. ```sh pnpm install pnpm dev ``` -------------------------------- ### Project Setup and Development Commands Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy/templates/react-router/README.md Provides essential npm commands for managing the React Router project, including installing dependencies, starting the development server with Hot Module Replacement (HMR), previewing the production build, and building for production. ```bash npm install npm run dev npm run preview npm run build ``` -------------------------------- ### Authenticate with Cloudflare Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/getting-started.mdx Logs you into your Cloudflare account via the Alchemy CLI. This is necessary to deploy resources to Cloudflare. Ensure you have a Cloudflare account. ```bun bun alchemy login ``` ```npm npx alchemy login ``` ```pnpm pnpm alchemy login ``` ```yarn yarn alchemy login ``` -------------------------------- ### Tear Down Alchemy Resources Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/getting-started.mdx Uses the Alchemy CLI to delete all deployed resources associated with the project. This command is used for cleaning up infrastructure from the Cloudflare account. ```sh bun alchemy destroy ``` ```sh npx alchemy destroy ``` ```sh pnpm alchemy destroy ``` ```sh yarn alchemy destroy ``` -------------------------------- ### Local Development for Vite App Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/cloudflare-vitejs.mdx Command to start the local development server for the Vite.js application, allowing for real-time testing. ```sh bun run dev ``` ```sh npm run dev ``` ```sh pnpm run dev ``` ```sh yarn run dev ``` -------------------------------- ### Deploy to Production Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/getting-started.mdx Deploys your Alchemy-defined infrastructure, including the Cloudflare Worker, to the production environment. After deployment, you can access your worker via its public URL. ```bun bun alchemy deploy ``` ```npm npx alchemy deploy ``` ```pnpm pnpm alchemy deploy ``` ```yarn yarn alchemy deploy ``` -------------------------------- ### Run TanStack.com Dev Server with Local Docs Source: https://github.com/sam-goodwin/alchemy/blob/main/examples/cloudflare-tanstack-start/README.md Navigates into the cloned TanStack.com directory, installs its dependencies, and starts the development server. This allows previewing local documentation changes at a specified URL. ```sh cd tanstack.com pnpm i pnpm dev ``` -------------------------------- ### Worker Code Example Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/getting-started.mdx Provides the TypeScript code for a simple Cloudflare Worker. This worker handles incoming requests and returns a JSON response with a message and timestamp. ```typescript export default { async fetch(request: Request): Promise { return Response.json({ message: "Hello from Alchemy!", timestamp: new Date().toISOString(), }); }, }; ``` -------------------------------- ### Create and Install RedwoodSDK Project Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy/templates/rwsdk/README.md Commands to create a new RedwoodSDK project, navigate into its directory, and install dependencies using pnpm. ```shell npx create-rwsdk my-project-name cd my-project-name pnpm install ``` -------------------------------- ### Create Astro Project Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy/templates/astro/README.md Command to create a new Astro project using the 'basics' template with Bun. ```sh bun create astro@latest -- --template basics ``` -------------------------------- ### Start Development Server Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy/templates/nuxt/README.md Starts the Nuxt development server on http://localhost:3000. ```bash # npm npm run dev # pnpm pnpm dev # yarn yarn dev # bun bun run dev ``` -------------------------------- ### Integrate React-Specific ESLint Plugins Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy/templates/vite/README.md This code example shows how to add and configure `eslint-plugin-react-x` and `eslint-plugin-react-dom` to an ESLint configuration. It includes enabling recommended TypeScript rules from `eslint-plugin-react-x` and recommended rules from `eslint-plugin-react-dom`. ```js // eslint.config.js import reactX from 'eslint-plugin-react-x' import reactDom from 'eslint-plugin-react-dom' export default tseslint.config({ plugins: { // Add the react-x and react-dom plugins 'react-x': reactX, 'react-dom': reactDom, }, rules: { // other rules... // Enable its recommended typescript rules ...reactX.configs['recommended-typescript'].rules, ...reactDom.configs.recommended.rules, }, }) ``` -------------------------------- ### Deploy TanStack Start Application Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tanstack-start.mdx Executes the deployment script for the TanStack Start application to Cloudflare Workers. This command initiates the build and deployment process. ```sh bun run deploy ``` ```sh npm run deploy ``` ```sh pnpm run deploy ``` ```sh yarn run deploy ``` -------------------------------- ### Astro Project Commands Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy/templates/astro/README.md Lists essential commands for managing an Astro project, including dependency installation, development server, building, previewing, and CLI operations. ```APIDOC Astro Project Commands: - bun install - Action: Installs dependencies. - bun dev - Action: Starts local dev server at `localhost:4321`. - bun build - Action: Build your production site to `./dist/`. - bun preview - Action: Preview your build locally, before deploying. - bun astro ... - Action: Run CLI commands like `astro add`, `astro check`. - bun astro -- --help - Action: Get help using the Astro CLI. ``` -------------------------------- ### Local Development Server Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tanstack-start.mdx Starts the local development server for the TanStack Start application, allowing for real-time testing and debugging. Supports multiple package managers. ```sh bun run dev ``` ```sh npm run dev ``` ```sh pnpm run dev ``` ```sh yarn run dev ``` -------------------------------- ### Install Alchemy with Bun Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/blogs/2025-07-01-how-alchemy-is-different.md Shows the simple command to install the Alchemy library using the Bun package manager, emphasizing its zero-dependency philosophy and ease of setup. ```sh bun add alchemy ``` -------------------------------- ### Build for Production Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy/templates/nuxt/README.md Builds the Nuxt application for production deployment. ```bash # npm npm run build # pnpm pnpm build # yarn yarn build # bun bun run build ``` -------------------------------- ### Development Workflow Recommendation Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/cloudflare-nuxt.mdx Advises on the correct order for running Alchemy and Nuxt development servers to avoid errors. It recommends running `alchemy dev` first, which then launches `nuxt dev`. ```bash # Recommended command to start both Alchemy and Nuxt development servers alchemy dev ``` -------------------------------- ### Project Structure Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy/templates/astro/README.md Illustrates the typical folder and file structure of an Astro project. ```text / ├── public/ │ └── favicon.svg ├── src/ │ ├── layouts/ │ │ └── Layout.astro │ └── pages/ │ └── index.astro └── package.json ``` -------------------------------- ### Run TanStack.com in Development Mode Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy/templates/tanstack-start/README.md Instructions to navigate into the cloned tanstack.com directory, install its dependencies, and run it in development mode. The application will be accessible at https://localhost:3000. ```sh cd tanstack.com pnpm i pnpm dev ``` -------------------------------- ### Initialize SvelteKit Project with Alchemy Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/cloudflare-sveltekit.mdx Create a new SvelteKit project using the Alchemy CLI. This command initializes the project with the specified template and navigates into the project directory. ```sh bunx alchemy create my-sveltekit-app --template=sveltekit cd my-sveltekit-app ``` ```sh npx alchemy create my-sveltekit-app --template=sveltekit cd my-sveltekit-app ``` ```sh pnpm dlx alchemy create my-sveltekit-app --template=sveltekit cd my-sveltekit-app ``` ```sh yarn dlx alchemy create my-sveltekit-app --template=sveltekit cd my-sveltekit-app ``` -------------------------------- ### TanStack Start Integration with Alchemy Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/concepts/dev.mdx Integrates Alchemy with TanStack Start applications. Requires setup in `alchemy.run.ts`, adding the Alchemy plugin to `vite.config.ts`, and configuring the `tanstackStart` plugin. ```ts import { TanStackStart } from "alchemy/cloudflare"; const tanstackStart = await TanStackStart("my-tanstack-start-app"); ``` ```ts import alchemy from "alchemy/cloudflare/tanstack-start"; import { tanstackStart } from "@tanstack/react-start/plugin/vite"; import viteReact from "@vitejs/plugin-react"; import { defineConfig } from "vite"; export default defineConfig({ plugins: [ alchemy(), tanstackStart({ target: "cloudflare-module", customViteReactPlugin: true, }), viteReact(), ], }); ``` -------------------------------- ### Destroy Cloudflare Resources Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tanstack-start.mdx Cleans up all Cloudflare resources that were created by the TanStack Start stack. This command is used for removing deployed applications and associated services. ```sh bun run destroy ``` ```sh npm run destroy ``` ```sh pnpm run destroy ``` ```sh yarn run destroy ``` -------------------------------- ### Deploy Application with Alchemy Source: https://github.com/sam-goodwin/alchemy/blob/main/examples/docker/README.md Executes the deployment script for the Alchemy Docker provider example using Bun. This command initiates the creation and configuration of Docker resources. ```bash bun run deploy ``` -------------------------------- ### Preview Production Build Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy/templates/nuxt/README.md Locally previews the production build of the Nuxt application. ```bash # npm npm run preview # pnpm pnpm preview # yarn yarn preview # bun bun run preview ``` -------------------------------- ### Vite Configuration for TanStack Start Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tanstack-start.mdx Configures Vite for a TanStack Start project, including the Alchemy plugin, tsconfig-paths, and the tanstackStart plugin for Cloudflare module targeting. It specifies build targets and externalizes certain Node.js and Cloudflare worker modules. ```typescript import { tanstackStart, } from "@tanstack/react-start/plugin/vite"; import viteReact from "@vitejs/plugin-react"; import alchemy from "alchemy/cloudflare/tanstack-start"; import { defineConfig } from "vite"; import tsConfigPaths from "vite-tsconfig-paths"; export default defineConfig({ build: { target: "esnext", rollupOptions: { external: ["node:async_hooks", "cloudflare:workers"], }, }, plugins: [ alchemy(), tsConfigPaths({ projects: ["./tsconfig.json"], }), tanstackStart({ target: "cloudflare-module", customViteReactPlugin: true, }), viteReact(), ], }); ``` -------------------------------- ### Create Basic ApiGateway Method (GET) Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/providers/aws-control/api-gateway/method.md Create a basic ApiGateway Method for a GET request with default settings. This example demonstrates setting the RestApiId, ResourceId, HttpMethod, AuthorizationType, and ApiKeyRequired properties. ```ts import AWS from "alchemy/aws/control"; const apiGatewayMethod = await AWS.ApiGateway.Method("getUserMethod", { RestApiId: "myApiId", ResourceId: "myResourceId", HttpMethod: "GET", AuthorizationType: "NONE", ApiKeyRequired: false }); ``` -------------------------------- ### Example Database Connection Details Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/planetscale-drizzle.mdx An example of the database connection details that might be logged after deploying an Alchemy stack. This output provides the necessary information to connect to your PlanetScale database. ```bash { database: "sample-database", branch: "my-planetscale-app-dev-branch", host: "aws.connect.psdb.cloud" } ``` -------------------------------- ### Start Development Mode Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/getting-started.mdx Runs the Alchemy application in development mode, enabling hot reloading for your Cloudflare Worker. Changes to your worker code will be reflected instantly without manual restarts. ```bun bun alchemy dev ``` ```npm npx alchemy dev ``` ```pnpm pnpm alchemy dev ``` ```yarn yarn alchemy dev ``` -------------------------------- ### Alchemy Configuration Example Source: https://github.com/sam-goodwin/alchemy/blob/main/examples/cloudflare-nuxt-pipeline/README.md Illustrates the structure of an `alchemy.run.ts` file, which defines the build process, resource provisioning, and deployment configuration for Alchemy projects. ```typescript // alchemy.run.ts // This file defines the build and deployment process for Alchemy. // It specifies build commands, resource names, and worker entrypoints. // Example structure (actual content may vary): /* import { defineConfig, definePipeline, defineWorker, defineAssets, } from "@alchemy/sdk"; export default defineConfig({ build: { command: "bun run build", // Command to build the Nuxt app }, pipeline: definePipeline({ name: "nuxt3-pipeline-demo", // Name of the Cloudflare Pipeline queue }), worker: defineWorker({ entrypoint: ".output/server/index.mjs", // Path to the worker entrypoint name: "nuxt3-basic-worker", // Name of the Cloudflare Worker }), assets: defineAssets({ dir: ".output/public", // Directory containing static assets }), }); */ ``` -------------------------------- ### Run Astro Development Server Source: https://github.com/sam-goodwin/alchemy/blob/main/examples/cloudflare-astro/README.md Starts the Astro development server for local testing and development. This command allows for hot-reloading and local previewing of the application. ```bash bun run dev ``` -------------------------------- ### Configure Advanced DNSSEC Setup Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/providers/aws-control/route53/dnssec.md Configures an advanced AWS Route53 DNSSEC setup with specific adoption settings. This example demonstrates setting `adopt` to false, preventing the adoption of any existing DNSSEC configuration. ```typescript const advancedDNSSEC = await AWS.Route53.DNSSEC("advancedDNSSEC", { HostedZoneId: "Z3M3LM4B2R8A5F", // Replace with your actual Hosted Zone ID adopt: false // Do not adopt existing DNSSEC configuration }); ``` -------------------------------- ### Create RedwoodJS Drizzle Project Source: https://github.com/sam-goodwin/alchemy/blob/main/examples/cloudflare-redwood/README.md Initializes a new RedwoodJS project pre-configured with Drizzle ORM. It uses `degit` to clone the example repository and `pnpm` for dependency installation. ```shell npx degit redwoodjs/example-drizzle my-project-name cd my-project-name pnpm install ``` -------------------------------- ### Navigate to Example Directory Source: https://github.com/sam-goodwin/alchemy/blob/main/examples/cloudflare-nuxt-pipeline/README.md Changes the current directory to the specific example folder for Nuxt 3. This is a prerequisite for running example-specific commands. ```bash cd examples/nuxt3-basic ``` -------------------------------- ### Install Dependencies (Package Managers) Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/planetscale-drizzle.mdx Installs necessary packages for PlanetScale database integration and Drizzle ORM, including development tools like drizzle-kit. Supports Bun, npm, pnpm, and yarn. ```sh bun add @planetscale/database drizzle-orm bun add -D drizzle-kit ``` ```sh npm install @planetscale/database drizzle-orm npm install -D drizzle-kit ``` ```sh pnpm add @planetscale/database drizzle-orm pnpm add -D drizzle-kit ``` ```sh yarn add @planetscale/database drizzle-orm yarn add -D drizzle-kit ``` -------------------------------- ### Install Dependencies Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy/templates/nuxt/README.md Installs project dependencies using different package managers. ```bash # npm npm install # pnpm pnpm install # yarn yarn install # bun bun install ``` -------------------------------- ### Complete VPC Setup with Internet Gateway Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/providers/aws/internet-gateway.md Illustrates a comprehensive AWS setup involving a VPC, Internet Gateway, subnet, route table, and routing configuration. This example connects a public subnet to the internet via the gateway. ```ts import { Vpc, InternetGateway, InternetGatewayAttachment, Subnet, RouteTable, Route, RouteTableAssociation } from "alchemy/aws/ec2"; // Create VPC const vpc = await Vpc("web-vpc", { cidrBlock: "10.0.0.0/16", enableDnsHostnames: true, enableDnsSupport: true }); // Create Internet Gateway const igw = await InternetGateway("web-igw", { tags: { Name: "web-internet-gateway" } }); // Attach Internet Gateway to VPC const attachment = await InternetGatewayAttachment("web-igw-attachment", { internetGateway: igw, vpc: vpc }); // Create public subnet const publicSubnet = await Subnet("public-subnet", { vpc, cidrBlock: "10.0.1.0/24", availabilityZone: "us-east-1a", mapPublicIpOnLaunch: true }); // Create route table for public subnet const publicRouteTable = await RouteTable("public-rt", { vpc, tags: { Name: "public-route-table" } }); // Add route to Internet Gateway const internetRoute = await Route("internet-route", { routeTable: publicRouteTable, destinationCidrBlock: "0.0.0.0/0", target: { internetGateway: igw } }); // Associate subnet with route table const routeAssociation = await RouteTableAssociation("public-association", { routeTable: publicRouteTable, subnet: publicSubnet }); ``` -------------------------------- ### Alchemy Create Command Examples Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/concepts/cli.mdx Shows how to use the `alchemy create` command to scaffold new projects, including options for templates, package managers, and overwriting existing files. ```sh # create a new project interactively alchemy create my-app # create with a specific template alchemy create my-app --template vite # skip prompts and use defaults alchemy create my-app --yes # specify package manager alchemy create my-app --pm bun # overwrite existing directory alchemy create my-app --overwrite # create without installing dependencies alchemy create my-app --no-install ``` -------------------------------- ### Preview Production Build Source: https://github.com/sam-goodwin/alchemy/blob/main/examples/cloudflare-react-router/README.md Builds the application for production and starts a local server to preview the production build. ```bash npm run preview ``` -------------------------------- ### Test Tunnel Connectivity Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tunnel.mdx Command to test the Cloudflare Tunnel by curling the configured hostname. ```sh curl https://app.example.com ``` -------------------------------- ### Complete Authentication Setup Example Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/providers/random/random-string.md Provides a comprehensive example of setting up authentication by generating multiple secrets (JWT secret, session secret, database password) and configuring a Cloudflare Worker with these secrets as environment variables and a PostgreSQL database. ```ts import { RandomString } from "alchemy/random"; import { Worker } from "alchemy/cloudflare"; import { PostgresDatabase } from "alchemy/neon"; // Generate all required secrets const jwtSecret = await RandomString("jwt-secret", { length: 64 }); const sessionSecret = await RandomString("session-secret", { length: 32 }); const dbPassword = await RandomString("db-password"); // Create database with secure password const database = await PostgresDatabase("auth-db", { name: "authentication", password: dbPassword.value }); // Create worker with secrets as environment variables const authWorker = await Worker("auth-api", { entrypoint: "./src/auth.ts", bindings: { JWT_SECRET: jwtSecret.value, SESSION_SECRET: sessionSecret.value, DATABASE_URL: database.connectionUrl } }); ``` -------------------------------- ### Resource Adoption Example Source: https://github.com/sam-goodwin/alchemy/blob/main/alchemy-web/src/content/docs/what-is-alchemy.md Shows how to configure Alchemy resources to adopt existing infrastructure if it already exists, preventing creation failures and allowing management of pre-existing resources. ```typescript // Without adoption - fails if bucket already exists const bucket = await R2Bucket("my-bucket", { name: "existing-bucket", }); // With adoption - uses existing bucket if it exists const bucket = await R2Bucket("my-bucket", { name: "existing-bucket", adopt: true, }); ```