A Dart package for interacting with the Cloudflare Web API. This package provides a type-safe, easy-to-use interface for managing Cloudflare resources including zones, DNS records, Workers, Pages, Analytics, and more.
Note: Not all endpoints and models have been added currently, so this package does not have feature parity with the full Cloudflare API. Additional endpoints and models are being added over time.
Add this package to your pubspec.yaml:
dependencies:
cloudflare_sdk: ^0.2.1Then run:
dart pub get- Dart SDK:
>=3.8.0 <4.0.0 - Flutter:
>=3.24.0
You'll need a Cloudflare API token. You can create one in your Cloudflare Dashboard.
import 'package:cloudflare_sdk/cloudflare_sdk.dart';
void main() async {
// Initialize the API client
final api = CloudflareApi.fromAccessToken('your-api-token-here');
// Initialize the client (required before making requests)
await api.init();
// Use the API endpoints
final zones = await api.zones.get();
print('Found ${zones.length} zones');
}Contributions are welcome! Please feel free to submit a Pull Request.
This package is used in Kyno for Cloudflare app.