WebDyne::Cloudflare::KV

Future-returning Workers KV facade. Construct with new(scope => $scope_hr, binding => 'CACHE'); the default binding is KV. binding() returns its name.

Interface

All operations return Futures. Read types are text, json and bytes. blob($bytes) accepts function, class or object invocation and one byte payload. Missing values return undef. KV is eventually consistent; reads may be stale.

The JavaScript adapter enforces kvMaxValueBytes (16 MiB by default) on writes and returned values. Provider reads are buffered before this check; this is a bridge payload limit, not a streaming-memory guarantee. Errors fail with KV::Error. Invalid capabilities throw at construction. Internal validation and host-call helpers are not supported API.

Text inputs, including nested metadata keys and values, are normalized from unflagged UTF-8 without changing caller data. Invalid UTF-8, cyclic containers and duplicate normalized keys are rejected before calling the host. See the usage guide.