Axiom Cloudflare Workers is an open-source project and welcomes your contributions. For more information, see the GitHub repository.
What is Cloudflare Workers
Cloudflare Workers is a serverless computing platform developed by Cloudflare. The Workers platform allows developers to deploy and run JavaScript code directly at the network edge in more than 200 data centers worldwide. This serverless architecture enables high performance, low latency, and efficient scaling for web apps and APIs.Prerequisites
- Create an Axiom account.
- Create a dataset in Axiom where you send your data.
- Create an API token in Axiom with permissions to update the dataset you have created.
Send Cloudflare Worker logs to Axiom
- In Cloudflare, create a new worker. For more information, see the Cloudflare documentation.
- Copy the contents of the src/worker.js file into the worker you have created.
-
Update the authentication variables:
- Replace
API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable. - Replace
DATASET_NAME
with the name of the Axiom dataset where you want to send data.
- Replace
- Add triggers for the worker. For example, add a route trigger using the Cloudflare documentation.