Requirements
Alchemy requires one of the following JavaScript runtimes:Package Installation
Install Alchemy using your preferred package manager:TypeScript Configuration
Alchemy is built with TypeScript and works best with a properly configuredtsconfig.json.
Recommended TypeScript Config
Create or update yourtsconfig.json:
tsconfig.json
The
"types": ["@cloudflare/workers-types"] is only needed if you’re using Cloudflare Workers. Remove it if you’re using other providers.Provider-Specific Setup
Depending on which cloud providers you plan to use, you may need additional dependencies.Cloudflare
For Cloudflare Workers, R2, D1, KV, and other services:.env
How to get Cloudflare credentials
How to get Cloudflare credentials
- Account ID: Log into Cloudflare dashboard, find it on the right sidebar
- API Token: Create at API Tokens page
- Use “Edit Cloudflare Workers” template
- Grant Account > Workers Scripts > Edit
- Grant Account > Account Settings > Read
- Password: Choose a strong password for encrypting secrets
AWS
For AWS Lambda, DynamoDB, S3, and other services:.env
GitHub
For managing GitHub repositories, secrets, and actions:.env
Database Providers
- Neon
- PlanetScale
- Prisma Postgres
.env
Project Structure
Here’s a recommended project structure for an Alchemy project:.gitignore Configuration
Make sure to ignore sensitive files:.gitignore
Verify Installation
Create a simple test file to verify everything is working:test-alchemy.ts
CLI Commands
Alchemy scripts support several CLI flags for different operations:Deployment Commands
Common Flag Combinations
IDE Setup
VS Code
Install recommended extensions:- TypeScript and JavaScript Language Features (built-in)
- ESLint - For linting
- Prettier - For code formatting
.vscode/settings.json:
.vscode/settings.json
IntelliJ / WebStorm
- Enable TypeScript support: Settings → Languages & Frameworks → TypeScript
- Set TypeScript version to project version
- Enable ESLint and Prettier in settings
Troubleshooting
Module Resolution Errors
If you see “Cannot find module ‘alchemy’”:- Make sure
alchemyis in yourpackage.jsondependencies - Run
npm installorbun install - Check that
"moduleResolution": "bundler"is in yourtsconfig.json
Type Errors with Workers Types
If you see type errors with Cloudflare Workers:- Install types:
npm install -D @cloudflare/workers-types - Add to
tsconfig.json:
Permission Errors
If deployment fails with permission errors:- Verify your API credentials in
.env - Check that your API token has the required permissions
- For Cloudflare: Ensure you have Workers Scripts > Edit permission
State File Corruption
If state files are corrupted:- Back up
.alchemy/directory - Delete corrupted state files
- Run with
--adoptto re-adopt existing resources
Next Steps
Quickstart
Deploy your first Cloudflare Worker in 5 minutes
Core Concepts
Learn about Resources, Scopes, and State
Providers
Explore all available cloud providers
Examples
Browse complete example projects
Need help? Join our Discord community or open an issue on GitHub.