๐ Variables and Secrets
Variable and secrets are bound as follows:
const mf = new Miniflare({ bindings: { KEY1: "value1", KEY2: "value2", },});
Text and data blobs can be loaded from files. File contents will be read and
bound as string
s and ArrayBuffer
s respectively.
const mf = new Miniflare({ textBlobBindings: { TEXT: "text.txt" }, dataBlobBindings: { DATA: "data.bin" },});
Injecting arbitrary globals is not supported by workerd โ. If you're using a service Worker, bindings will be injected as globals, but these must be JSON-serialisable.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark