cloudflare
11.0.1, released 7 days ago by dev.lamt.dev
Dart SDK and client for Cloudflare APIs including Images, Stream, Live Inputs, and R2 storage.
WASM-ready
What it does
Provides a Dart client for interacting with Cloudflare services. It supports managing and uploading images, streaming videos, live inputs, and S3-compatible R2 object storage operations.
AI-written summary of version 11.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to integrate Cloudflare Images, Stream, or Live Inputs into a Dart or Flutter application.
- You are using Cloudflare R2 object storage and need an S3-compatible client implementation.
- You need to perform direct or tus-protocol resumable video and image uploads.
Skip it when
- You are looking for a general-purpose local database or device storage package.
- You require backend services outside of what Cloudflare provides.
Strengths
- Covers multiple major Cloudflare services (Images, Stream, Live Inputs, R2).
- Supports direct and resumable uploads using the tus protocol.
- Compatible with both server-side Dart and client-side Flutter applications.
Weaknesses
- Exposing sensitive credentials directly in client-side applications requires careful use of direct upload flows.
- Requires managing Cloudflare account IDs and API tokens or keys properly.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 14
Add the package to pubspec.yaml and initialize the Cloudflare client with your account ID and authentication tokens.
cloudflare = Cloudflare(
accountId: accountId,
token: token,
);
final response = await cloudflare.imageAPI.upload(
contentFromFile: DataTransmit<XFile>(data: imageFile)
);Works with
Packages commonly used together with cloudflare: ones it builds on, ones built on it, and its own family.
- cryptocloudflare depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- xmlcloudflare depends on itFull-featured XML and XPath library for DOM parsing, SAX streaming, and fluent building.
- json_annotationcloudflare depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- http_parsercloudflare depends on itA platform-independent package for parsing and serializing HTTP formats.
- diocloudflare depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- retrofitcloudflare depends on itDart Dio client generator using source_gen
- cross_filecloudflare depends on itAn abstraction to allow working with files across multiple platforms.
- aws_signature_v4cloudflare depends on itDart implementation of AWS Signature Version 4 for signing HTTP requests.