Component Registry¶
The Run 2.0 registry allows you to publish, share, and install WASI components.
Official Registry¶
The official registry is hosted at:
Package Naming¶
Packages follow the format:
Examples:
wasi:http@0.2.0myorg:utils@1.0.0alice:calculator@2.1.3
Installing Packages¶
From run.toml¶
Add dependencies to your run.toml:
Then install:
Direct Install¶
Install a specific package:
Install as dev dependency:
Update Packages¶
Update all dependencies:
Update specific package:
Publishing Packages¶
1. Configure Authentication¶
Get a token from the registry administrator, then set it:
2. Configure Project¶
Ensure your run.toml has required metadata:
[project]
name = "myorg" # This becomes the namespace
version = "1.0.0"
description = "My awesome component"
license = "MIT"
repository = "https://github.com/myorg/mypackage"
[[component]]
name = "calculator" # Package name: myorg:calculator
source = "src/lib.rs"
language = "rust"
wit = "wit/calculator.wit"
3. Publish¶
Build and publish:
Or publish pre-built components:
Publish specific component:
4. Verify¶
Check your package on the registry:
Registry API¶
The registry provides a REST API:
| Endpoint | Method | Description |
|---|---|---|
/packages | GET | List all packages |
/browse | GET | Browse packages (HTML) |
/browse/:name | GET | Package detail (HTML) |
/api/v1/packages | POST | Publish package |
/api/v1/packages/:name/versions | GET | List versions |
/api/v1/packages/:name/:version | GET | Get metadata |
/api/v1/search?q=query | GET | Search packages |
/api/v1/stats | GET | Registry statistics |
/health | GET | Health check |
Examples¶
List packages:
Search:
Get package info:
Self-Hosted Registry¶
You can run your own registry server.
Deploy to Render¶
- Fork the run repository
- Create a new Web Service on Render
- Connect to the
registry-server/directory - Set environment variables:
REGISTRY_ADMIN_TOKEN: Admin token for publishingPORT: Server port (Render sets this automatically)DATA_DIR: Data directory (default:./data)
Environment Variables¶
| Variable | Description |
|---|---|
PORT | Server port |
DATA_DIR | Data storage directory |
REGISTRY_URL | Public base URL for download links (critical for hosted deploys) |
MAX_UPLOAD_MB | Max upload size (default: 50) |
REGISTRY_ADMIN_TOKEN | Admin token (can publish to any namespace) |
REGISTRY_TOKENS | Namespace tokens (format: ns1:token1,ns2:token2) |
Token Types¶
Admin Token:
- Set via
REGISTRY_ADMIN_TOKEN - Can publish to any namespace
- For registry administrators
Namespace Tokens:
- Set via
REGISTRY_TOKENS - Format:
namespace:token,namespace:token - Each token can only publish to its namespace
Example:
alicetoken can publishalice:*packagesbobtoken can publishbob:*packagesacmetoken can publishacme:*packages
Verify Integrity¶
Verify installed packages against the lockfile:
This checks SHA256 hashes of all cached components.
Custom Registry URL¶
Use a custom registry:
Or via environment:
Or per-command: