Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Cloudflare SDK

No security coverage Under active development 7 sites

Part of the Cloudflare ecosystem · 20 projects

This module provides the core framework for other Cloudflare modules, managing API credentials and shared HTTP services. It allows you to configure multiple sets of Cloudflare credentials, securely stored in your settings.php file, and enables other modules to leverage these credentials for Cloudflare interactions.

The framework layer for the Cloudflare module suite, built on the standalone Cloudflare API client. It provides named credential sets, resolution of account IDs and API tokens from settings.php, a shared HTTP client factory, and the provisioning framework that the other Cloudflare modules build on.

You usually install this module because another Cloudflare module (such as the Cloudflare AI Gateway) depends on it. On its own it adds a small admin screen for managing credential sets and the services those modules use; it makes no calls to Cloudflare by itself.

Features

  • A credential set configuration entity, identified by a machine name and label only. Nothing account-specific is stored in configuration or the database.
  • Account ID and API token resolved from settings.php, keyed by the credential set's machine name ($settings['cloudflare']['credentials'][<id>]).
  • Support for multiple named credential sets, for example different tokens for different purposes or accounts.
  • A pluggable credential resolver behind an interface, so the secret source can be changed without changing callers.
  • A shared HTTP client factory that binds a base URI and default headers over Drupal core's HTTP client, with a typed exception.
  • A provisioning framework (capabilities, primitives, a reconciler and deployment appliers) that lets feature modules declare the Cloudflare resources they need and have them reconciled.

Post-Installation

This module has no standalone features beyond credential management; you install it because another Cloudflare module needs it. After enabling it:

  1. Add a credential set at Configuration > Web services > Cloudflare credentials, giving it a machine name.
  2. Add its account ID and API token to settings.php, keyed by that machine name:
    $settings['cloudflare']['credentials']['my_account'] = [
      'account_id' => 'your-account-id',
      'token' => 'your-token',
    ];

Other Cloudflare modules then reference the credential set by its machine name.

Additional Requirements

This module requires the Cloudflare API module, which Composer installs automatically. To make a credential set useful you need a Cloudflare account and an API token. While the suite is in alpha, install it together with its alpha dependencies:

composer require drupal/cloudflare_sdk:^1.0@alpha drupal/cloudflare_api:^1.0@alpha

Composer applies a stability flag such as @alpha only to packages the root composer.json requires, so on a site with minimum-stability: stable, requiring this module alone fails. Alternatively, allow alpha releases site-wide with minimum-stability: alpha and prefer-stable: true.

This module exists to support the rest of the Cloudflare suite:

Similar projects

The existing Cloudflare module integrates CDN and cache management. This module is narrower and reusable: a credential and HTTP foundation that keeps account IDs and tokens in settings.php and gives the other Cloudflare suite modules one shared credential model.

Supporting this Module

Issue reports, patches and feedback are welcome in the project's issue queue.

Community Documentation

For creating a Cloudflare API token, see Cloudflare's documentation at developers.cloudflare.com/fundamentals/api/get-started/create-token.

Ask your assistant about Cloudflare SDK

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
7
Tracked since
Jun 2026
Latest release
3 months ago
Releases (12 mo)
7 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.0-alpha7 Pre-release 10–11 Jul 11, 2026
1.0.0-alpha6 Pre-release 10–11 Jul 11, 2026
1.0.0-alpha5 Pre-release 10–11 Jul 11, 2026
1.0.0-alpha4 Pre-release 10–11 Jul 10, 2026
1.0.0-alpha3 Pre-release 10–11 Jul 7, 2026
1.0.0-alpha2 Pre-release 10–11 Jun 21, 2026
1.0.0-alpha1 Pre-release 10–11 Jun 21, 2026