How to create a Cloudflare worker for Raptive

Please follow these steps to get your Cloudflare Account ID and create an API token with permissions to edit Cloudflare Workers.

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

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:
    • Token Name:
      • Click the Edit icon to change the name if desired (we would recommend  “Raptive API Token”)

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

    • Account Resources:
      • Select Include → Your account
      • Only give us access to your account (in the scenario you have access to multiple accounts).
    • Zone Resources:
      • Select Include Specific zone Your domain. The Cloudflare worker that we deploy will be scoped to only work for the domain specified

    • Client IP Address Filtering: You can leave this field empty.
    • TTL: You may leave this empty to ensure this token does not expire until you choose to manually remove it.
  • Click Continue to summary, review, and then select Create Token on the subsequent page.

  • Copy the API token. You'll need this in the last step to securely send us this value.
    • Once created, you’ll see your API token. Copy and save it securely—you won’t be able to view it again.

Sharing with Raptive

Save your Cloudflare Account ID and the newly created API token - here in the Raptive Creator Dashboard.  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.

Cloudflare Credentials in dashboard.png

This allows Raptive to create a worker on your Cloudflare instance and allows Raptive to set this cookie. 

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

Want to join Raptive? Apply here!