- Home
- Skills
- Cameronapak
- Bknd Skills
- Bknd Storage Config
bknd-storage-config_skill
2
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill cameronapak/bknd-skills --skill bknd-storage-config- SKILL.md11.8 KB
Overview
This skill helps configure storage backends for Bknd's media module, covering S3-compatible services (AWS S3, Cloudflare R2, DigitalOcean Spaces), Cloudinary, and the local filesystem adapter for development. It provides concrete configuration patterns, environment variable guidance, runtime constraints, and troubleshooting tips to get uploads working in dev and production.
How this skill works
The skill outlines adapter-specific setup steps and example code for defineConfig or Cloudflare serve wrappers. It explains required credentials, URL formats, CORS needs, body_max_size controls, and how to switch adapters by environment. It also includes verification steps (list/upload via API or curl) and common error causes with fixes.
When to use it
- You need to configure storage backends in code because the admin UI does not support it.
- You want S3-compatible storage (AWS, R2, Spaces, MinIO) or Cloudinary for production media delivery.
- You need a local filesystem adapter for development with Node.js or Bun.
- You are deploying to Cloudflare Workers and need the R2 binding configuration.
- You must set different adapters or limits per environment (dev vs production).
Best practices
- Keep credentials in environment variables and never commit them to source control.
- Set body_max_size in production to prevent large or abusive uploads.
- Choose adapters compatible with your runtime: local only for Node/Bun; use s3/r2/cloudinary for serverless.
- Validate adapter URLs (no trailing slash) and use correct S3-compatible URL formats.
- Configure bucket CORS for browser uploads and restrict bucket access with least privilege.
Example use cases
- Local development: register the local adapter and store uploads under ./uploads with hot reload.
- Production AWS S3: configure access_key/secret and URL using environment variables and set a 50MB upload limit.
- Cloudflare Workers: bind an R2 bucket in wrangler.toml and configure the r2 adapter with the binding name.
- Cloudinary: use cloud_name, api_key, api_secret for transformed images and optional upload_preset for unsigned uploads.
- Hybrid setups: local adapter in dev and s3 adapter in production selected via NODE_ENV.
FAQ
Common causes are invalid credentials, incorrect bucket URL (watch trailing slash), or restrictive bucket policy. Verify keys, URL format, and permissions.
When should I use the local adapter?
Use local only for development on Node.js or Bun where filesystem access is available. Do not use local in edge runtimes or serverless production.