Getting Started
Cloudflare Worker setup
Create a Cloudflare Worker, add the Honeylog values, and attach it to the website domain.
Use this guide when Cloudflare handles visits to the website. You will create a Cloudflare Worker for Honeylog and connect it to the website domain.
#Before you open Cloudflare
Sign in to the Cloudflare account that manages the website. Your account must be allowed to create Workers and connect them to the website domain. If these options are not available, send this guide to the person who manages Cloudflare for you.
#Choose install method
Choose one of these methods:
- One-click install: use this if you have a GitHub or GitLab account that you can connect to Cloudflare.
- Manual install: use this if you want to complete everything in the Cloudflare dashboard without connecting GitHub or GitLab.
#One-click install
Open the private Honeylog installation page under Settings > Installation > Cloudflare Worker, then start the guided Cloudflare deployment.
- Create the website in Honeylog and choose Cloudflare Worker.
- Start the guided Cloudflare deploy from Honeylog.
- When Cloudflare asks for configuration values, paste only the three values shown below. Use the personalized values from Honeylog, not the placeholders in this public guide.
- Finish the deployment and wait until Cloudflare shows that the Worker was deployed successfully.
- Continue with Add domain or route below.
Values to paste into Cloudflare:
HONEYLOG_API_URL=https://api.honeylog.io/events
HONEYLOG_INGESTION_SECRET=SITE_TOKEN
HONEYLOG_SITE_DOMAIN=SITE_DOMAIN
Template defaults:
HONEYLOG_SITE_SCHEME=https
HONEYLOG_EVENT_NAME=pageview
HONEYLOG_SKIP_PATH_REGEX=\.(?:css|js|mjs|map|png|jpe?g|gif|svg|ico|webp|avif|woff2?|ttf)$
Leave the template defaults unchanged unless Honeylog support or your Cloudflare team has given you different values.
#Manual install
- In Cloudflare, open Workers & Pages.
- Click
Create application.
- Choose
Start with Hello World!.
- Deploy the starter Worker and wait until Cloudflare confirms that the deployment is complete.
- Click
Edit code, remove the starter code, and paste the complete Honeylog Worker code shown on the private installation page.
- Save and deploy again. Continue only when Cloudflare shows that the new deployment is active.
Worker script:
#Add variables and secrets
- Open the Worker settings.
- Add each variable and secret shown on the private Honeylog installation page. Match the name, value, and type exactly.
- Leave the template defaults unchanged unless Honeylog support or your Cloudflare team has given you different values.
Before continuing, confirm that all required names appear in the Worker's Variables and Secrets list.
#Add domain or route
- Open the Worker's
Domainssection and chooseAdd domainorAdd route.
- Paste the route pattern generated by the private Honeylog installation page. The public example below uses a placeholder.
- Save the route and confirm that it appears in the Worker's domain list.
- Open a few public pages on the website.
- Return to Honeylog and confirm that the new visits appear. This is the final confirmation that the Worker is connected to the website.
Route pattern:
*.SITE_DOMAIN/*