### Initialize project and install Alchemy with bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Step 1 of the getting started guide: create a new project and install Alchemy using bun.
```sh
bun init -y
bun add alchemy
```
--------------------------------
### Initialize project and install Alchemy with pnpm
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Step 1 of the getting started guide: create a new project and install Alchemy using pnpm.
```sh
pnpm init
pnpm add alchemy
```
--------------------------------
### Initialize project and install Alchemy with yarn
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Step 1 of the getting started guide: create a new project and install Alchemy using yarn.
```sh
yarn init -y
yarn add alchemy
```
--------------------------------
### Initialize project and install Alchemy with npm
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Step 1 of the getting started guide: create a new project and install Alchemy using npm.
```sh
npm init -y
npm install alchemy
```
--------------------------------
### Provider getting started guide template
Source: https://github.com/alchemy-run/alchemy-async/blob/main/AGENTS.md
Template for a provider guide in ./alchemy-web/docs/guides/{provider}.md. Includes frontmatter with order, title, and description, then sections for Install, Credentials, Create application, Create alchemy.run.ts, Deploy, and Tear Down. The guide uses code groups for bun, npm, pnpm, and yarn commands.
```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}
## Install
{any installation pre-requisites}
::: code-group
```sh [bun]
bun ..
```
```sh [npm]
npm ...
```
```sh [pnpm]
pnpm ..
```
```sh [yarn]
yarn ..
```
:::
## Credentials
{how to get credentials and store in .env}
## Create a {Provider} application
{code group with commands to run to init a new project}
## Create `alchemy.run.ts`
{one or more subsequent code snippets with explanations for using alchemy to provision this provider}
## Deploy
Run `alchemy.run.ts` script to deploy:
::: code-group
```sh [bun]
bun ./alchemy.run
```
```sh [npm]
npx tsx ./alchemy.run
```
```sh [pnpm]
pnpm tsx ./alchemy.run
```
```sh [yarn]
yarn tsx ./alchemy.run
```
:::
It should log out the ... {whatever information is relevant for interacting with the app deployed to this provider}
```sh
{expected output}
```
## Tear Down
That's it! You can now tear down the app (if you want to):
::: code-group
```sh [bun]
bun ./alchemy.run --destroy
```
```sh [npm]
npx tsx ./alchemy.run --destroy
```
```sh [pnpm]
pnpm tsx ./alchemy.run --destroy
```
```sh [yarn]
yarn tsx ./alchemy.run --destroy
```
:::
```
--------------------------------
### Navigate to Example Directory
Source: https://github.com/alchemy-run/alchemy-async/blob/main/examples/cloudflare-sveltekit/README.md
Change to the example directory before running deployment or development commands.
```bash
cd examples/cloudflare-sveltekit
```
--------------------------------
### Install and run commands
Source: https://github.com/alchemy-run/alchemy-async/blob/main/examples/cloudflare-livestore/README.md
Commands to install dependencies, run locally, and deploy to Cloudflare.
```bash
bun install
bun dev # run locally
bun run deploy # or deploy to Cloudflare
```
--------------------------------
### Run the application with Bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/tanstack-start/README.md
Install dependencies and start the development server using Bun.
```bash
bun install
bunx --bun run start
```
--------------------------------
### Start development server on http://localhost:3000
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/nuxt/README.md
Start the development server, which runs at http://localhost:3000. Use the command matching your package manager.
```bash
# npm
npm run dev
```
```bash
# pnpm
pnpm dev
```
```bash
# yarn
yarn dev
```
```bash
# bun
bun run dev
```
--------------------------------
### Install dependencies with npm install
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/nextjs/README.md
Run this command to install all project dependencies as part of the initial setup.
```bash
npm install
```
--------------------------------
### Start development server with npm run dev
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/sveltekit/README.md
Start the development server after installing dependencies. Use --open to open the app in a new browser tab.
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
--------------------------------
### Install Bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/CONTRIBUTING.md
Install Bun, a prerequisite for the project, using the official install script.
```sh
curl -fsSL https://bun.sh/install | bash
```
--------------------------------
### Install dependencies with npm, pnpm, yarn, or bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/nuxt/README.md
Install project dependencies using your preferred package manager. The commands are equivalent alternatives; choose one based on your environment.
```bash
# npm
npm install
```
```bash
# pnpm
pnpm install
```
```bash
# yarn
yarn install
```
```bash
# bun
bun install
```
--------------------------------
### Install Alchemy and Clickhouse client with bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/clickhouse.mdx
Use bun to add the Alchemy package and the Clickhouse client-web package. This is the first step in setting up a Clickhouse database with Alchemy.
```bash
bun add alchemy @clickhouse/client-web
```
--------------------------------
### Install Dependencies with bun i
Source: https://github.com/alchemy-run/alchemy-async/blob/main/CONTRIBUTING.md
Install all dependencies using Bun workspaces.
```sh
bun i
```
--------------------------------
### Create project and install dependencies (bun)
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/prisma-d1.mdx
Initializes a new project directory and installs Alchemy, Prisma client, and D1 adapter dependencies using bun.
```sh
mkdir prisma-d1-app
cd prisma-d1-app
```
```sh
bun init -y
bun add alchemy @prisma/client @prisma/adapter-d1
bun add -D prisma @types/node @cloudflare/workers-types typescript
```
--------------------------------
### Create project and install dependencies (npm)
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/prisma-d1.mdx
Initializes a new project directory and installs Alchemy, Prisma client, and D1 adapter dependencies using npm.
```sh
mkdir prisma-d1-app
cd prisma-d1-app
```
```sh
npm init -y
npm install alchemy @prisma/client @prisma/adapter-d1
npm install -D prisma @types/node @cloudflare/workers-types typescript
```
--------------------------------
### Destroy Cloudflare Resources
Source: https://github.com/alchemy-run/alchemy-async/blob/main/examples/cloudflare-sveltekit/README.md
Run from the example directory to clean up all created resources.
```bash
cd examples/cloudflare-sveltekit
bun run destroy
```
--------------------------------
### Install Dependencies and Run Script
Source: https://github.com/alchemy-run/alchemy-async/blob/main/examples/prisma-postgres/README.md
Installs dependencies and runs the Alchemy script. The script prints the generated database connection string to stdout.
```bash
bun i
ALCHEMY_PASSWORD=${ALCHEMY_PASSWORD:-dev-password} bun run alchemy.run.ts
```
--------------------------------
### Install required packages
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/sqlite/sqlite-state-store.mdx
Install `drizzle-orm` and `@libsql/client` as peer dependencies.
```sh
npm install drizzle-orm @libsql/client
```
--------------------------------
### Install Alchemy and Clickhouse client with npm
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/clickhouse.mdx
Use npm to add the Alchemy package and the Clickhouse client-web package. This is the first step in setting up a Clickhouse database with Alchemy.
```bash
npm install alchemy @clickhouse/client-web
```
--------------------------------
### Example layout with header and Outlet
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/tanstack-start/README.md
A root layout example that includes a header, navigation links, an Outlet for route content, and TanStack Router Devtools.
```tsx
import { Outlet, createRootRoute } from '@tanstack/react-router'
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import { Link } from "@tanstack/react-router";
export const Route = createRootRoute({
component: () => (
<>
>
),
})
```
--------------------------------
### Install Alchemy and Clickhouse client with yarn
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/clickhouse.mdx
Use yarn to add the Alchemy package and the Clickhouse client-web package. This is the first step in setting up a Clickhouse database with Alchemy.
```bash
yarn add alchemy @clickhouse/client-web
```
--------------------------------
### Set sample prompts control mode
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/qbusiness/web-experience.md
Creates a WebExperience with samplePromptsControlMode set to "active" to enable guided prompts. Includes welcomeMessage for user guidance.
```TypeScript
const samplePromptsWebExperience = await AWS.QBusiness.WebExperience("samplePromptsWebExperience", {
applicationId: "app-789012",
title: "Sample Prompts Experience",
samplePromptsControlMode: "active",
origins: ["https://example.com"],
welcomeMessage: "Explore our features with guided prompts!"
});
```
--------------------------------
### Install Alchemy and Clickhouse client with pnpm
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/clickhouse.mdx
Use pnpm to add the Alchemy package and the Clickhouse client-web package. This is the first step in setting up a Clickhouse database with Alchemy.
```bash
pnpm add alchemy @clickhouse/client-web
```
--------------------------------
### Create project and install dependencies (pnpm)
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/prisma-d1.mdx
Initializes a new project directory and installs Alchemy, Prisma client, and D1 adapter dependencies using pnpm.
```sh
mkdir prisma-d1-app
cd prisma-d1-app
```
```sh
pnpm init
pnpm add alchemy @prisma/client @prisma/adapter-d1
pnpm add -D prisma @types/node @cloudflare/workers-types typescript
```
--------------------------------
### Create project and install dependencies (yarn)
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/prisma-d1.mdx
Initializes a new project directory and installs Alchemy, Prisma client, and D1 adapter dependencies using yarn.
```sh
mkdir prisma-d1-app
cd prisma-d1-app
```
```sh
yarn init -y
yarn add alchemy @prisma/client @prisma/adapter-d1
yarn add -D prisma @types/node @cloudflare/workers-types typescript
```
--------------------------------
### Install dependencies with bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/drizzle-d1.mdx
Initializes a bun project and installs alchemy, drizzle-orm, and dev dependencies.
```sh
bun init -y
bun add alchemy drizzle-orm
bun add -D drizzle-kit @types/node
```
--------------------------------
### Access Cloudflare Resources via platform
Source: https://github.com/alchemy-run/alchemy-async/blob/main/examples/cloudflare-sveltekit/README.md
Alternative method using the platform parameter in a +page.server.ts file.
```typescript
// In a +page.server.ts file
export async function load({ platform }) {
const kvData = await platform?.env?.AUTH_STORE?.get('some-key');
const r2Object = await platform?.env?.STORAGE?.get('some-file');
return { kvData };
}
```
--------------------------------
### Install TanStack Store with bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/tanstack-start/README.md
Adds the @tanstack/store package as a dependency using the bun package manager.
```bash
bun install @tanstack/store
```
--------------------------------
### Install dependencies with pnpm
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/drizzle-d1.mdx
Initializes a pnpm project and installs alchemy, drizzle-orm, and dev dependencies.
```sh
pnpm init
pnpm add alchemy drizzle-orm
pnpm add -D drizzle-kit @types/node
```
--------------------------------
### Install dependencies with npm
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/drizzle-d1.mdx
Initializes an npm project and installs alchemy, drizzle-orm, and dev dependencies.
```sh
npm init -y
npm install alchemy drizzle-orm
npm install -D drizzle-kit @types/node
```
--------------------------------
### Install dependencies with yarn
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/drizzle-d1.mdx
Initializes a yarn project and installs alchemy, drizzle-orm, and dev dependencies.
```sh
yarn init -y
yarn add alchemy drizzle-orm
yarn add -D drizzle-kit @types/node
```
--------------------------------
### Install React Query dependencies with bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/tanstack-start/README.md
Installs @tanstack/react-query and @tanstack/react-query-devtools using bun. This is the first step to integrating React Query into the application.
```bash
bun install @tanstack/react-query @tanstack/react-query-devtools
```
--------------------------------
### Configure Alchemy profile with bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Step 2: set up a profile to manage cloud provider credentials. Profiles help manage credentials for multiple accounts.
```sh
bun alchemy configure
```
--------------------------------
### Multi-Tenant Architecture Example
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/cloudflare/dispatch-namespace.md
A complete example showing how to create a multi-tenant setup with customer-specific workers, a dispatch namespace, and a main router.
```APIDOC
## Multi-Tenant Architecture Example
### Description
A complete example showing how to create a multi-tenant setup with customer-specific workers, a dispatch namespace, and a main router.
### Request Example
```ts
import {
Worker,
DispatchNamespace,
KVNamespace,
Json,
} from "alchemy/cloudflare";
// Create a dispatch namespace for tenant workers
const tenants = await DispatchNamespace("tenants", {
namespace: "customer-workers",
});
// Create KV namespace for tenant metadata
const tenantData = await KVNamespace("tenant-data", {
title: "Tenant Configuration",
});
// Deploy tenant-specific workers
const tenantWorkerA = await Worker("tenant-a", {
name: "customer-a-worker",
entrypoint: "./src/tenant-worker.ts",
namespace: tenants,
bindings: {
CONFIG: Json({
customerId: "customer-a",
features: ["feature1", "feature2"],
}),
},
});
const tenantWorkerB = await Worker("tenant-b", {
name: "customer-b-worker",
entrypoint: "./src/tenant-worker.ts",
namespace: tenants,
bindings: {
CONFIG: Json({
customerId: "customer-b",
features: ["feature1", "feature3"],
}),
},
});
// Create the main router that handles all tenant requests
const mainRouter = await Worker("main-router", {
name: "platform-router",
entrypoint: "./src/main-router.ts",
bindings: {
TENANT_NAMESPACE: tenants,
TENANT_DATA: tenantData,
},
routes: [
{
pattern: "*.platform.example.com/*",
},
],
});
```
```
--------------------------------
### Run the development server with npm, yarn, pnpm, or bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/examples/cloudflare-nextjs/README.md
Start the Next.js development server. The page auto-updates when editing app/page.tsx. Use any of the four package managers; they are alternatives, not sequential steps.
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
--------------------------------
### Run cloudflared on Linux/macOS
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tunnel.mdx
Starts cloudflared with the tunnel token. The service install command is recommended; the foreground command is for testing.
```sh
# Run as a service (recommended)
sudo cloudflared service install
# Or run in foreground for testing
cloudflared tunnel run --token
```
--------------------------------
### Configure Alchemy profile with npm
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Step 2: set up a profile to manage cloud provider credentials. Profiles help manage credentials for multiple accounts.
```sh
npx alchemy configure
```
--------------------------------
### Run cloudflared on Windows
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tunnel.mdx
Starts cloudflared with the tunnel token on Windows. The service install command requires administrator privileges; the foreground command is for testing.
```powershell
# Run as a service (as administrator)
cloudflared.exe service install
# Or run in foreground for testing
cloudflared.exe tunnel run --token
```
--------------------------------
### Build application for production
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/nuxt/README.md
Build the application for production. Use the command matching your package manager.
```bash
# npm
npm run build
```
```bash
# pnpm
pnpm build
```
```bash
# yarn
yarn build
```
```bash
# bun
bun run build
```
--------------------------------
### Create basic LaunchRoleConstraint
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/service-catalog/launch-role-constraint.md
Creates a minimal LaunchRoleConstraint with PortfolioId, ProductId, and RoleArn. Use this as a starting point for managing launch role constraints for AWS Service Catalog products.
```ts
import AWS from "alchemy/aws/control";
const launchRoleConstraint = await AWS.ServiceCatalog.LaunchRoleConstraint("basicLaunchRoleConstraint", {
PortfolioId: "portfolio-12345678",
ProductId: "product-87654321",
RoleArn: "arn:aws:iam::123456789012:role/LaunchRole",
Description: "Launch role constraint for my product."
});
```
--------------------------------
### Install cloudflared on Windows
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tunnel.mdx
Installs the cloudflared connector on Windows using winget.
```powershell
winget install --id Cloudflare.cloudflared
```
--------------------------------
### Install cloudflared on macOS
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tunnel.mdx
Installs the cloudflared connector on macOS using Homebrew.
```sh
brew install cloudflared
```
--------------------------------
### Create a PartnerApp with maintenance configuration
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/sage-maker/partner-app.md
Example including a maintenanceConfig with a maintenance window start and end time. Uses tier 'Enterprise' and includes an applicationConfig with a lambda function ARN.
```TypeScript
const maintenancePartnerApp = await AWS.SageMaker.PartnerApp("maintenancePartnerApp", {
executionRoleArn: "arn:aws:iam::123456789012:role/SageMakerExecutionRole",
type: "Custom",
tier: "Enterprise",
authType: "IAM",
maintenanceConfig: {
maintenanceWindowStart: "2023-10-15T00:00:00Z",
maintenanceWindowEnd: "2023-10-15T02:00:00Z"
},
applicationConfig: {
lambdaFunctionArn: "arn:aws:lambda:us-west-2:123456789012:function:maintenanceFunction"
}
});
```
--------------------------------
### Start local HTTP server on port 3000
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/cloudflare-tunnel.mdx
Starts a simple HTTP server on port 3000 to test the tunnel. Replace with your actual application command if needed.
```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.
```
--------------------------------
### Configure Alchemy profile with pnpm
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Step 2: set up a profile to manage cloud provider credentials. Profiles help manage credentials for multiple accounts.
```sh
pnpm alchemy configure
```
--------------------------------
### Create a basic promotion code
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/stripe/promotion-code.md
Creates a basic Stripe promotion code with a coupon and code, and sets it active. Use this minimal example to get started with the PromotionCode resource.
```ts
import { PromotionCode } from "alchemy/stripe";
const basicPromoCode = await PromotionCode("summer-promo", {
coupon: "SUMMER25",
code: "SAVE25NOW",
active: true,
});
```
--------------------------------
### Access Cloudflare Resources via env
Source: https://github.com/alchemy-run/alchemy-async/blob/main/examples/cloudflare-sveltekit/README.md
Use in a +page.server.ts file to access KV and R2 bindings via the runtime environment.
```typescript
// In a +page.server.ts file
import { env } from "cloudflare:workers";
export async function load() {
const kvData = await env.AUTH_STORE?.get('some-key');
const r2Object = await env.STORAGE?.get('some-file');
return { kvData };
}
```
--------------------------------
### Run locally with bun alchemy dev
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/cloudflare-livestore.mdx
Start the local development server. Open http://localhost:8787 to see LiveStore in action.
```sh
bun alchemy dev
# open http://localhost:8787 to see LiveStore in action
```
--------------------------------
### Bun CLI commands for install, dev, deploy, destroy
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/bun-spa/README.md
Commands to install dependencies, start the development server with HMR, deploy to Cloudflare, and destroy resources. Use 'bun run dev' for development and 'bun run deploy' for production deployment.
```sh
# Install dependencies
bun install
# Start development server
bun run dev
# Deploy to Cloudflare
bun run deploy
# Destroy resources
bun run destroy
```
--------------------------------
### Create basic AnycastIpList with required and optional properties
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/cloud-front/anycast-ip-list.md
Creates an AWS CloudFront Anycast IP list with required properties IpCount and Name, plus an optional Tags property. Use this minimal example to get started with the Alchemy Cloud Control provider.
```ts
import AWS from "alchemy/aws/control";
const anycastIpList = await AWS.CloudFront.AnycastIpList("myAnycastIpList", {
IpCount: 2,
Name: "MyAnycastIPList",
Tags: {
Environment: "Production",
Team: "Networking"
}
});
```
--------------------------------
### Locally preview production build
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/nuxt/README.md
Locally preview the production build. Use the command matching your package manager.
```bash
# npm
npm run preview
```
```bash
# pnpm
pnpm preview
```
```bash
# yarn
yarn preview
```
```bash
# bun
bun run preview
```
--------------------------------
### Set Cloudflare Credentials as Environment Variables
Source: https://github.com/alchemy-run/alchemy-async/blob/main/examples/cloudflare-sveltekit/README.md
Required for deployment. Can also be placed in a .env file in the repository root.
```bash
export CLOUDFLARE_API_TOKEN="your_api_token"
export CLOUDFLARE_ACCOUNT_ID="your_account_id"
```
--------------------------------
### Create Astro project with bun create
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/astro/README.md
Command to scaffold a new Astro project using the 'basics' template. Run from a terminal.
```sh
bun create astro@latest -- --template basics
```
--------------------------------
### Configure WebExperience with advanced settings
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/qbusiness/web-experience.md
Creates a WebExperience with customization (theme color, logo URL) and identity provider configuration (Cognito user pool and app client). Includes tags for resource management.
```TypeScript
const advancedWebExperience = await AWS.QBusiness.WebExperience("advancedWebExperience", {
applicationId: "app-654321",
title: "Advanced Web Experience",
origins: ["https://example.com"],
customizationConfiguration: {
themeColor: "#ff5733",
logoUrl: "https://example.com/logo.png"
},
identityProviderConfiguration: {
provider: "Cognito",
userPoolId: "us-east-1_ABCDEFG",
appClientId: "abcdefgh12345678"
},
tags: [
{ key: "Environment", value: "Production" },
{ key: "Project", value: "WebApp" }
]
});
```
--------------------------------
### Create a basic Pinpoint App with AWS.Pinpoint.App
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/pinpoint/app.md
Creates a Pinpoint App with a specified name and optional tags. Use this minimal example to get started with the App resource.
```ts
import AWS from "alchemy/aws/control";
const pinpointApp = await AWS.Pinpoint.App("myPinpointApp", {
name: "My Awesome App",
tags: {
environment: "production",
team: "marketing"
}
});
```
--------------------------------
### Build for production with Bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/tanstack-start/README.md
Build the application for production using Bun.
```bash
bunx --bun run build
```
--------------------------------
### Create a basic Detective Graph with auto member enabling
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/detective/graph.md
Creates an AWS Detective Graph with AutoEnableMembers set to true and two tags. Use this minimal example to get started with the Graph resource.
```TypeScript
import AWS from "alchemy/aws/control";
const detectiveGraph = await AWS.Detective.Graph("myDetectiveGraph", {
AutoEnableMembers: true,
Tags: [
{ Key: "Project", Value: "Security" },
{ Key: "Environment", Value: "Production" }
]
});
```
--------------------------------
### Navigate to example directory
Source: https://github.com/alchemy-run/alchemy-async/blob/main/examples/cloudflare-nuxt-pipeline/README.md
Change to the example directory before running deployment or development commands.
```bash
cd examples/nuxt3-basic
```
--------------------------------
### Create a basic SQS queue
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/sqs/queue.md
Creates a standard SQS queue with a visibility timeout of 30 seconds and no initial delay. Use this minimal example to get started with queue creation.
```ts
import AWS from "alchemy/aws/control";
const basicQueue = await AWS.SQS.Queue("basicQueue", {
QueueName: "BasicQueue",
VisibilityTimeout: 30, // Message visibility timeout in seconds
DelaySeconds: 0 // No initial delay for messages
});
```
--------------------------------
### Astro CLI commands
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/astro/README.md
Lists common commands run from the project root: install, dev server, build, preview, and CLI help.
```text
bun install
```
```text
bun dev
```
```text
bun build
```
```text
bun preview
```
```text
bun astro ...
```
```text
bun astro -- --help
```
--------------------------------
### Create a new Alchemy project with bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Use the `alchemy create` command to generate a new project with the TypeScript template. This is an alternative to manually creating the project.
```sh
bunx alchemy@latest create --template typescript
```
--------------------------------
### Create a basic ThreatIntelSet with required properties
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/guard-duty/threat-intel-set.md
Creates a GuardDuty ThreatIntelSet with required properties (format, location, activate, detectorId) and common optional settings. Use this minimal example to get started.
```TypeScript
import AWS from "alchemy/aws/control";
const threatIntelSet = await AWS.GuardDuty.ThreatIntelSet("basicIntelSet", {
format: "TXT",
location: "https://example.com/threat-intel.txt",
activate: true,
detectorId: "detector-1234567890abcdef"
});
```
--------------------------------
### Create a full Prisma Postgres setup with Project and Database
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/prisma-postgres/connection.md
Creates a project, a database, and a connection in sequence. The `Connection` resource accepts a `Database` object and an optional `name`. Logs host, user, unencrypted password, and connection string.
```TypeScript
import { Project, Database, Connection } from "alchemy/prisma-postgres";
const project = await Project("my-app");
const database = await Database("production", {
project: project,
});
const connection = await Connection("app-connection", {
database: database,
name: "production-api-connection"
});
console.log(`Host: ${connection.host}`);
console.log(`User: ${connection.user}`);
console.log(`Password: ${connection.password?.unencrypted}`);
console.log(`Connection String: ${connection.connectionString.unencrypted}`);
```
--------------------------------
### Navigate to example directory
Source: https://github.com/alchemy-run/alchemy-async/blob/main/examples/docker/README.md
Command to change into the example directory before running the example.
```bash
cd examples/docker
```
--------------------------------
### Create QueryClient and provider in main.tsx
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/tanstack-start/README.md
Creates a QueryClient and wraps the RouterProvider with QueryClientProvider in main.tsx. This setup is required to use React Query hooks throughout the app.
```tsx
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
// ...
const queryClient = new QueryClient();
// ...
if (!rootElement.innerHTML) {
const root = ReactDOM.createRoot(rootElement);
root.render(
);
}
```
--------------------------------
### Configure Alchemy profile with yarn
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Step 2: set up a profile to manage cloud provider credentials. Profiles help manage credentials for multiple accounts.
```sh
yarn alchemy configure
```
--------------------------------
### Create basic WebExperience with required properties
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/qbusiness/web-experience.md
Creates a minimal AWS QBusiness WebExperience using the Alchemy Cloud Control provider. Requires an applicationId, title, and origins array; welcomeMessage is optional.
```TypeScript
import AWS from "alchemy/aws/control";
const basicWebExperience = await AWS.QBusiness.WebExperience("basicWebExperience", {
applicationId: "app-123456",
title: "Basic Web Experience",
origins: ["https://example.com"],
welcomeMessage: "Welcome to our basic web experience!"
});
```
--------------------------------
### Create a basic QBusiness Retriever with AWS.QBusiness.Retriever
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/qbusiness/retriever.md
Minimal example creating a QBusiness Retriever with required properties (Type, Configuration, DisplayName, ApplicationId) and an optional RoleArn. Use this as a starting point for basic retriever setup.
```ts
import AWS from "alchemy/aws/control";
const basicRetriever = await AWS.QBusiness.Retriever("basicRetriever", {
Type: "DataSource",
Configuration: {
// Configuration details go here
},
DisplayName: "Basic Data Retriever",
ApplicationId: "myAppId",
RoleArn: "arn:aws:iam::123456789012:role/MyRetrieverRole"
});
```
--------------------------------
### Run the dev server
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/rwsdk/README.md
Starts the development server. After running, point your browser to the URL displayed in the terminal (e.g., http://localhost:5173/) to see a 'Hello World' message.
```shell
pnpm dev
```
--------------------------------
### Configure browser extension for WebExperience
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/qbusiness/web-experience.md
Creates a WebExperience with browser extension configuration specifying extension ID and permissions, plus a role ARN for IAM permissions.
```TypeScript
const browserExtensionWebExperience = await AWS.QBusiness.WebExperience("browserExtensionWebExperience", {
applicationId: "app-345678",
title: "Browser Extension Experience",
origins: ["https://example.com"],
browserExtensionConfiguration: {
extensionId: "com.example.extension",
permissions: ["tabs", "storage"]
},
roleArn: "arn:aws:iam::123456789012:role/WebExperienceRole"
});
```
--------------------------------
### Create a basic RefactorSpaces Application
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/refactor-spaces/application.md
Creates a basic AWS RefactorSpaces Application with required properties (environmentIdentifier, vpcId, proxyType, name) and optional apiGatewayProxy and tags. Use this minimal example to get started with application creation.
```TypeScript
import AWS from "alchemy/aws/control";
const myApplication = await AWS.RefactorSpaces.Application("my-app", {
environmentIdentifier: "env-123456",
vpcId: "vpc-abcde123",
proxyType: "ApiGateway",
name: "MyApplication",
apiGatewayProxy: {
apiGatewayId: "api-123456"
},
tags: [
{ key: "Environment", value: "Development" },
{ key: "Project", value: "MyProject" }
]
});
```
--------------------------------
### Create a basic Transit Gateway with AWS.EC2.TransitGateway
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/ec2/transit-gateway.md
Creates a Transit Gateway with a description and default route table settings. Use this minimal example to get started with managing Transit Gateways via Alchemy Cloud Control.
```TypeScript
import AWS from "alchemy/aws/control";
const transitGateway = await AWS.EC2.TransitGateway("myTransitGateway", {
Description: "Primary Transit Gateway for connecting VPCs",
AssociationDefaultRouteTableId: "default-route-table-id",
Tags: [
{
Key: "Name",
Value: "MyTransitGateway"
}
]
});
```
--------------------------------
### Create a QuickConnect with tags for resource management
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/connect/quick-connect.md
Creates a QuickConnect with the same required properties as the minimal example, but adds Tags for better resource management and monitoring. The Tags array uses Key-Value pairs, here for Department and Priority.
```ts
const advancedQuickConnect = await AWS.Connect.QuickConnect("advancedQuickConnect", {
Name: "SalesLine",
InstanceArn: "arn:aws:connect:us-west-2:123456789012:instance/abc12345-abc1-abc1-abc1-abc123456789",
QuickConnectConfig: {
QuickConnectType: "USER",
UserConfig: {
UserArn: "arn:aws:connect:us-west-2:123456789012:user/def67890-def6-def6-def6-def678901234",
ContactFlowId: "contact-flow-id-456"
}
},
Tags: [
{ Key: "Department", Value: "Sales" },
{ Key: "Priority", Value: "High" }
],
Description: "QuickConnect for sales inquiries"
});
```
--------------------------------
### Create an environment with custom branch deployment patterns
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/github/repository-environment.md
This example creates a staging environment with custom branch policies, allowing deployment from branches matching the specified patterns. Reviewers are specified by team ID and user ID.
```typescript
import { RepositoryEnvironment } from "alchemy/github";
const stagingEnv = await RepositoryEnvironment("staging-environment", {
owner: "my-org",
repository: "my-repo",
name: "staging",
reviewers: {
teams: [1234567], // team ID
users: [7654321], // user ID
},
deploymentBranchPolicy: {
protectedBranches: false,
customBranchPolicies: true,
},
branchPatterns: ["main", "release/*"],
});
```
--------------------------------
### Run tests with Vitest
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/tanstack-start/README.md
Execute the test suite using Vitest via Bun.
```bash
bunx --bun run test
```
--------------------------------
### Configure DataAccessor with multiple action configurations
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/qbusiness/data-accessor.md
Creates a DataAccessor with multiple ActionConfigurations (Read and Write) and a custom principal. Demonstrates advanced configuration for broader access.
```TypeScript
const advancedDataAccessor = await AWS.QBusiness.DataAccessor("advancedDataAccessor", {
DisplayName: "Advanced Data Accessor",
ActionConfigurations: [
{
Action: "Read",
Resource: "arn:aws:qbusiness:us-west-2:123456789012:resource-id-read"
},
{
Action: "Write",
Resource: "arn:aws:qbusiness:us-west-2:123456789012:resource-id-write"
}
],
ApplicationId: "myAppId",
Principal: "admin@mydomain.com",
Tags: [
{ Key: "Environment", Value: "Production" }
]
});
```
--------------------------------
### Create a new RedwoodSDK project
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy/templates/rwsdk/README.md
Use this command sequence to scaffold a new RedwoodSDK project with the standard starter template, which includes Vite, Prisma via D1, DurableObjects session management, Webauthn passkey authentication, and R2 storage.
```shell
npx create-rwsdk my-project-name
cd my-project-name
pnpm install
```
--------------------------------
### Create a basic MediaLive Channel with AWS Cloud Control
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/media-live/channel.md
Creates a minimal MediaLive Channel using the alchemy/aws/control provider. Includes input attachment, destination with RTMP URL and secret password, and encoder settings. Use as a starting point for basic streaming setups.
```ts
import AWS from "alchemy/aws/control";
const mediaLiveChannel = await AWS.MediaLive.Channel("basicChannel", {
InputAttachments: [{
InputId: "input-12345",
InputSettings: {
SourceEndBehavior: "CONTINUE",
InputFilter: "AUTO",
// Additional input settings can be specified here
}
}],
Destinations: [{
Id: "destination-1",
Settings: [{
Url: "rtmp://example.com/live",
Username: "user",
PasswordParam: alchemy.secret(process.env.STREAM_PASSWORD!)
}]
}],
EncoderSettings: {
OutputGroups: [{
Name: "streamingGroup",
Outputs: [{
VideoDescriptionName: "video_1",
AudioDescriptionNames: ["audio_1"],
Destination: {
DestinationRefId: "destination-1"
}
}]
}],
// Additional encoder settings can be specified here
},
Name: "MyMediaLiveChannel"
});
```
--------------------------------
### Install dependencies with yarn
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/cloudflare-livestore.mdx
Install the required packages for a LiveStore sync backend on Cloudflare Workers with React and Alchemy.
```sh
yarn add alchemy @livestore/livestore @livestore/adapter-web @livestore/react @livestore/sync-cf react react-dom vite
```
--------------------------------
### Install dependencies with pnpm
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/cloudflare-livestore.mdx
Install the required packages for a LiveStore sync backend on Cloudflare Workers with React and Alchemy.
```sh
pnpm add alchemy @livestore/livestore @livestore/adapter-web @livestore/react @livestore/sync-cf react react-dom vite
```
--------------------------------
### Install dependencies with npm
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/cloudflare-livestore.mdx
Install the required packages for a LiveStore sync backend on Cloudflare Workers with React and Alchemy.
```sh
npm install alchemy @livestore/livestore @livestore/adapter-web @livestore/react @livestore/sync-cf react react-dom vite
```
--------------------------------
### Create a production environment with approval requirements and protected branches
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/github/repository-environment.md
This example creates a production environment with a 10-minute wait timer, prevents self-review, and specifies reviewers by team name and username. It also enables protected branch deployment policy.
```typescript
import { RepositoryEnvironment } from "alchemy/github";
const prodEnv = await RepositoryEnvironment("prod-environment", {
owner: "my-org",
repository: "my-repo",
name: "production",
waitTimer: 10, // 10 minute delay
preventSelfReview: true,
reviewers: {
teams: ["platform-team"], // team name
users: ["security-admin"], // username
},
deploymentBranchPolicy: {
protectedBranches: true,
customBranchPolicies: false,
},
});
```
--------------------------------
### Install dependencies with bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/cloudflare-livestore.mdx
Install the required packages for a LiveStore sync backend on Cloudflare Workers with React and Alchemy.
```sh
bun add alchemy @livestore/livestore @livestore/adapter-web @livestore/react @livestore/sync-cf react react-dom vite
```
--------------------------------
### Run Alchemy deployment directly with CLI
Source: https://github.com/alchemy-run/alchemy-async/blob/main/examples/cloudflare-nuxt-pipeline/README.md
Alternative to 'bun run deploy' that invokes the Alchemy CLI directly.
```bash
bun ../../src/cli.ts run
```
--------------------------------
### PostgreSQL Example: Create Database, Branch, Roles, and DefaultRole
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/planetscale/index.md
Shows how to create a PostgreSQL database, a development branch, custom roles with inherited permissions, and a default role. Roles and DefaultRole are PostgreSQL-only.
```TypeScript
import { Database, Branch, Role, DefaultRole } from "alchemy/planetscale";
// Create a PostgreSQL database
const pgDatabase = await Database("my-pg-db", {
name: "my-pg-db",
organization: "my-org",
clusterSize: "PS_10",
kind: "postgresql",
allowDataBranching: true,
automaticMigrations: true,
});
// Create a development branch
const devBranch = await Branch("dev-branch", {
name: "development",
organization: "my-org",
database: pgDatabase,
parentBranch: "main",
isProduction: false,
});
// Create roles for database access (PostgreSQL only)
const readerRole = await Role("app-reader", {
database: pgDatabase,
branch: pgDatabase.defaultBranch,
inheritedRoles: ["pg_read_all_data", "pg_read_all_settings"],
});
const adminRole = await Role("app-admin", {
database: pgDatabase,
branch: devBranch,
inheritedRoles: ["postgres"],
ttl: 3600, // 1 hour
});
// Or use the default role for the branch (one per database/branch)
const defaultRole = await DefaultRole("default", { database: pgDatabase });
```
--------------------------------
### Create PlaybackConfiguration with live pre-roll settings
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/media-tailor/playback-configuration.md
Example including LivePreRollConfiguration with AdTagUri and Duration, plus SlateAdUrl for live content.
```TypeScript
const livePreRollConfig = await AWS.MediaTailor.PlaybackConfiguration("livePreRollConfig", {
VideoContentSourceUrl: "https://myvideosource.com/livecontent",
Name: "LivePreRollPlaybackConfig",
AdDecisionServerUrl: "https://adserver.com/ads",
LivePreRollConfiguration: {
// Example live pre-roll configuration
AdTagUri: "https://adserver.com/live/preroll",
Duration: 30
},
SlateAdUrl: "https://myvideosource.com/slatead"
});
```
--------------------------------
### Initialize Bun project and add Alchemy
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/cloudflare-bun-spa.mdx
Initializes a new Bun project with `bun init` and then adds Alchemy with the `bun alchemy init --framework bun-spa` command. The init command creates an `alchemy.run.ts` file, validates or creates `bunfig.toml` with `env='BUN_PUBLIC_*'`, adds `deploy`, `destroy`, and `alchemy:dev` scripts to `package.json`, and installs Alchemy as a dev dependency.
```sh
# If you haven't already, initialize your Bun project
bun init
# Add Alchemy to the existing project
bun alchemy init --framework bun-spa
```
--------------------------------
### Create basic PlaybackConfiguration with required properties
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/media-tailor/playback-configuration.md
Minimal example creating a PlaybackConfiguration with required properties (VideoContentSourceUrl, Name, AdDecisionServerUrl) and common optional settings like HlsConfiguration and Tags.
```TypeScript
import AWS from "alchemy/aws/control";
const playbackConfig = await AWS.MediaTailor.PlaybackConfiguration("basicPlaybackConfig", {
VideoContentSourceUrl: "https://myvideosource.com/content",
Name: "MyPlaybackConfig",
AdDecisionServerUrl: "https://adserver.com/ads",
HlsConfiguration: {
// Example HLS configuration
PlaylistType: "EVENT",
ContinuousPlaybackMode: "ON"
},
Tags: [
{ Key: "Environment", Value: "Production" },
{ Key: "Project", Value: "VideoStreaming" }
]
});
```
--------------------------------
### Initialize Prisma (bun)
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/guides/prisma-d1.mdx
Initializes Prisma in the project using bun.
```sh
bun prisma init
```
--------------------------------
### Create a basic APIGatewayOperation for a GET endpoint
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/cloudflare/api-gateway-operation.md
Creates a simple API endpoint operation for GET /users on api.example.com. Requires a Zone resource and the alchemy/cloudflare module.
```typescript
import { APIGatewayOperation, Zone } from "alchemy/cloudflare";
const zone = await Zone("example.com");
const getUserOp = await APIGatewayOperation("get-users", {
zone,
endpoint: "/users",
host: "api.example.com",
method: "GET"
});
```
--------------------------------
### Define path parameters with curly braces
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/cloudflare/api-gateway-operation.md
Uses curly braces to define a path parameter in the endpoint. The example creates an operation for GET /users/{id}.
```typescript
const getUserByIdOp = await APIGatewayOperation("get-user-by-id", {
zone,
endpoint: "/users/{id}",
host: "api.example.com",
method: "GET"
});
```
--------------------------------
### Create MySQL connection using Password resource
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/planetscale/password.md
Demonstrates creating a Password resource and using its connection details (host, username, unencrypted password) to establish a MySQL connection with SSL. The example then executes a simple SELECT query.
```TypeScript
import { Password } from "alchemy/planetscale";
import mysql from "mysql2/promise";
const password = await Password("app-db-access", {
name: "app-db-access",
organization: "my-org",
database: "my-app-db",
branch: "main",
role: "readwriter"
});
// Create MySQL connection
const connection = await mysql.createConnection({
host: password.host,
user: password.username,
password: password.password.unencrypted,
database: "my-app-db",
ssl: { rejectUnauthorized: true }
});
// Use the connection
const [rows] = await connection.execute('SELECT * FROM users LIMIT 10');
console.log(rows);
```
--------------------------------
### OpenAPI v3 schema example (schema.yaml)
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/cloudflare/api-shield.md
Example OpenAPI v3.0.0 schema file used to configure APIShield. Defines two GET endpoints: /users and /users/{id}.
```yaml
openapi: 3.0.0
info:
title: My API
version: 1.0.0
servers:
- url: https://api.example.com
paths:
/users:
get:
operationId: getUsers
responses:
'200':
description: Success
/users/{id}:
get:
operationId: getUser
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: User details
```
--------------------------------
### Create a basic CloudFront DistributionTenant
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/providers/aws-control/cloud-front/distribution-tenant.md
Minimal example creating a DistributionTenant with required properties (Domains, Enabled, DistributionId, Name) and a few common optional settings.
```ts
import AWS from "alchemy/aws/control";
const distributionTenant = await AWS.CloudFront.DistributionTenant("myDistributionTenant", {
Domains: ["mywebsite.com", "www.mywebsite.com"],
Enabled: true,
DistributionId: "E1234567890ABC",
Name: "Main Distribution Tenant"
});
```
--------------------------------
### Start development mode with yarn
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Step 6: run the Alchemy CLI in development mode with hot reloading. The worker will be available locally with live updates as you edit code.
```sh
yarn alchemy dev
```
--------------------------------
### Start development mode with pnpm
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Step 6: run the Alchemy CLI in development mode with hot reloading. The worker will be available locally with live updates as you edit code.
```sh
pnpm alchemy dev
```
--------------------------------
### Start development mode with npm
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Step 6: run the Alchemy CLI in development mode with hot reloading. The worker will be available locally with live updates as you edit code.
```sh
npx alchemy dev
```
--------------------------------
### Start development mode with bun
Source: https://github.com/alchemy-run/alchemy-async/blob/main/alchemy-web/src/content/docs/getting-started.mdx
Step 6: run the Alchemy CLI in development mode with hot reloading. The worker will be available locally with live updates as you edit code.
```sh
bun alchemy dev
```