How to create a Cloudflare worker for Raptive

Please follow these steps to get your Cloudflare Account ID and create an API token with permission to edit Cloudflare Workers. Since Cloudflare Workers work at the account level, not the domain level, you'll need to have access to the Workers Admin and DNS roles in Account Scoped Roles.

Please note, your Cloudlfare Accout ID is NOT the email address associated with your Cloudflare account.

Retrieving Your Account ID

  • Log in to Your Cloudflare Account
  • Find Your Cloudflare Account ID
    • There are two ways to find your Cloudflare account ID:
      • Click on Workers & Pages in the left sidebar of your Cloudflare dashboard and select Overview 

 

      • Your Account ID is a long string of numbers and letters that should be visible in the Account Details section on the right sidebar once you’ve selected Overview
    • If you're having trouble, here's another way to find your Account ID:
      • From your Cloudflare homepage, click on your domain

Cloudflare homepage.png

      • You should be taken to a page with your Account ID listed in the API section 
  • Cloudflare account ID.png
    • Either way, once you are able to see your Account ID, copy it and save it for later. This is something you'll need to provide at the end of these instructions. You can ignore the Zone ID for now.

Creating an API Token

  • Navigate to the API Tokens page here (or from your homepage)
    • Click your profile icon or account name on the top right, and select My Profile from the dropdown

.

    • On the left sidebar, click API Tokens.

  • Create a Custom API Token:
    • On the API Tokens page, click Create Token.

    • In the list of API token templates, find the row for Edit Cloudflare Workers and select Use template.

  • Configure the API Token:
    • Create Token:
      • Click the Edit icon to change the token name if desired (we would recommend “Raptive API Token”)

Cloudflare Edit.png

 

    • Permissions: You can leave permission settings as-is
      • You can expect the list to look as follows: 

image - 2024-10-09T112709.729.png

    • Account Resources:
      • Select Include → The site owner's account
      • Only give us access to the site owner's account (if you see multiple accounts listed).
    • Zone Resources:
      • Select Include Specific zone Your domain. The Cloudflare worker that we set up will only work for the domain specified. 
        • If you have multiple sites that you would like to set up with the same API Token, you can select All zones from an account The site owner's Account instead

    • Client IP Address Filtering: You can leave this field empty.
    • TTL: You can leave this empty to ensure this token does not expire until you choose to manually remove it.
  • Click Continue to summary

  • Review the information and then select Create Token.

 

 

  • Copy the API token by clicking the Copy button. You'll need the API token in the last step to securely send us this value and you won’t be able to view it again after this.

Sharing with Raptive

Save your Cloudflare Account ID and the newly created API token in your Raptive dashboard:

  • Log in to your Raptive account
  • Click on your profile picture
  • Select Account Settings
  • Click on Cloudflare Credentials on the left sidebar
  • Enter the Account ID and API Token in the fields
    • If you have multiple sites with Raptive, please input the Account ID and API token for each site. If you share a Cloudflare account for all your sites, the Account ID and API token may be the same for each site.
  • Click Save on the bottom right

Cloudflare Credentials in dashboard.png

Once saved, Raptive will attempt to deploy a Cloudflare Worker within a window of 5 business days. If successful, you should see a Raptive worker listed in your Cloudflare's Workers and Pages Overview. If there are any issues, we will contact you. 

If you have any questions or concerns, feel free to contact your CPM, AM, or Raptive's Support team.

Was this article helpful?
10 out of 12 found this helpful
Have more questions? Send a message

Want to join Raptive? Apply here!