cloudflare_sdk 0.2.0 copy "cloudflare_sdk: ^0.2.0" to clipboard
cloudflare_sdk: ^0.2.0 copied to clipboard

Cloudflare API Dart package

Cloudflare Dart SDK #

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.

Installation #

Add this package to your pubspec.yaml:

dependencies:
  cloudflare_sdk: ^0.2.0

Then run:

dart pub get

Requirements #

  • Dart SDK: >=3.8.0 <4.0.0
  • Flutter: >=3.24.0

Getting Started #

Authentication #

You'll need a Cloudflare API token. You can create one in your Cloudflare Dashboard.

Basic Usage #

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');
}

Contributing #

Contributions are welcome! Please feel free to submit a Pull Request.

0
likes
130
points
21
downloads

Publisher

verified publisherae1.dev

Weekly Downloads

Cloudflare API Dart package

Homepage

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

dio, freezed_annotation, graphql, hive_ce_generator, intl, json_annotation, talker, talker_dio_logger

More

Packages that depend on cloudflare_sdk