Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

@varlock/cloudflare-integration

npm version GitHub stars license

This package helps you integrate varlock into a Cloudflare Workers project.

It provides:

  • a Vite plugin (varlockCloudflareVitePlugin) that wraps @cloudflare/vite-plugin with automatic env var injection into miniflare bindings and Cloudflare's secret bindings at runtime, and auto-detects SvelteKit (projects using @sveltejs/adapter-cloudflare) to apply the right injection strategy without extra config
  • a varlock-wrangler CLI binary — a drop-in replacement for wrangler that injects env via named pipe in dev, uploads vars/secrets on deploy, and generates correct types
  • a standalone init module (@varlock/cloudflare-integration/init) for non-Vite workers
  • validation of your env vars against your .env.schema
  • type-generation and type-safe env var access with built-in docs
  • redaction of sensitive values from logs
  • leak prevention in responses

Compared to the base @varlock/vite-integration, this package avoids bundling secrets into your worker code. Instead, sensitive values are stored as Cloudflare secrets and non-sensitive values as Cloudflare vars.

See our docs site for complete installation and usage instructions.