INTEGRATE

Cloudflare Pages

You can use Phase to sync secrets with your Cloudflare Pages.

Prerequisites

Step 1: Authentication

Get your Cloudflare Account ID

  1. Log into the Cloudflare dashboard

  2. Click on Workers & Pages in the sidebar to the left.

Workers and Pages

  1. Copy the Account ID by clicking on the copy button in the Account Details section on the right.

Copy Account ID

Create a Cloudflare Token

  1. Go to Cloudflare's API tokens page and click on Create Token

Create token button

  1. In the Create API Tokens page, create a Custom Token by clicking on Get started in the Custom token section.

Select custom token

  1. Give your token a descriptive name and give it Edit access to Cloudflare Pages like in the screen below:

Token name and permissions

Scroll down and click Continue to summary

Continue to summary

  1. Confirm the permissions and create the token by clicking on Create token

Confirm permissions
Create token

Save your credentials in Phase

  1. Go to Integrations from the sidebar and click on Third-party credentials in the integrations tab.

Go to integrations

  1. Click on Cloudflare

Create Cloudflare credentials

  1. Copy and paste your Account ID and Access token from the Cloudflare dashboard. Add a descriptive name for these credentials and click Save

Input Cloudflare credentials

Step 2: Sync Secrets from Phase

Now that you have set up your Cloudflare account with Phase, you can start creating Syncs to manage your Cloudflare Pages sites.

Create Sync

  1. Select Cloudflare Pages under the 'Syncing' tab.

Create cloudflare pages sync

  1. Select the credentials stored in the previous step as the authentication method for this sync, and click Next

Choose sync authentication credentials

  1. Choose the source and destination to sync secrets. Select an Environment as the source for secrets along with the Path if you have a specific folder you want to sync from. Next, select your Cloudflare Pages project from the 'Cloudflare project' field, and select either the 'Preview' or 'Production' environment. Once you have selected your desired source and destination, click Create.

Choose sync source and destination

The sync has been set up! Secrets will automatically be Synced from your chosen Phase Environment to the Cloudflare pages project. You can click on the Manage button on the Sync card to view sync logs, pause syncing or update authentication credentials.

Sync created