Installation via Wrangler (CLI)
This section describes how to configure and deploy the Netacea's integration via the Wrangler.
Prerequisites
To successfully integrate using Netacea, please ensure you have:
Installed latest Wrangler V2, Node.js (version 16.13.0 or higher) and Git on you machine.
An active Cloudflare account with access to the Cloudflare Dashboard.
A “Paid” Cloudflare subscription, in order to avoid any issues with worker request-limits etc.
Access to the Cloudflare Workers product.
Implementation Steps
The detailed GitHub instructions to pull the code, configure and deploy the Netacea Cloudflare plugin can be found here.
Create local worker
Open Windows Command-Prompt/PowerShell and navigate to a directory where you can save the Netacea code.
Within that directory execute the following command
wrangler generate netacea-cloudflare-worker https://github.com/netacea/cloudflare-worker-template-typescript
This will use wrangler to create (generate) a new local worker bundle by pulling the latest Netacea GitHub code.

You can verify this by visiting the above directory and seeing the worker with the following format:

Configure the worker
Open the src directory and edit the NetaceaConfig.json
file to match the below:
{
"apiKey": "API-KEY-PROVIDED-BY-NETACEA",
"secretKey": "SECRET-KEY-PROVIDED-BY-NETACEA",
"mitigationType": "PREFERRED-MITIGATION-TYPE",
"ingestType": "KINESIS",
"kinesis": {
"kinesisStreamName": "NAME-PROVIDED-BY-NETACEA",
"kinesisAccessKey": "KEY-PROVIDED-BY-NETACEA",
"kinesisSecretKey": "KEY-PROVIDED-BY-NETACEA"
},
"cookieEncryptionKey": "ENCRYPTION-KEY-PROVIDED-BY-NETACEA",
"netaceaCookieName": "_cookieName",
"netaceaCaptchaCookieName": "_captchaCookieName",
"enableDynamicCaptchaContentType": false,
"timeout": 3000
}
Replace the values with the details that Netacea has provided you and save the file.
The cookieEncryptionKey, netaceaCookieName and netaceaCaptchaCookieName variables are used to increase security by concealing Netacea's default cookie names and values from public view.
Configure Wrangler
Navigate to the worker's root directory and edit the wrangler.toml
file:
name = "netacea-worker"
main = "./dist/worker.js"
account_id = "EXAMPLE_ACCOUNT_ID"
route = "EXAMPLE_ROUTE"
compatibility_date = "2023-05-04"
[observability]
enabled = true
Replace the values with the appropriate details and Once ready, save the file.
Install/Update npm
Within the worker root directory, execute the following two commands to ensure all the necessary node modules are installed/updated
npm i @netacea/cloudflare@latest
npm install
Deploy the worker to Cloudflare
Execute the following command:
npm run deploy
This might prompt you to login to Cloudflare via your browser and allow access to wrangler. If so, login and allow access.


Confirm Deployment
Login to Cloudflare, open the dashboard, select the domain where you want the worker to work on and finally select "Workers Routes" from the menu. You should be able to see the newly deployed worker, associated with the route from the wrangler.toml
file.

Deployments of each worker can be seen by clicking on the Worker(e.g. test-netacea-worker) and selecting the Deployment's tab:

For each worker, you can see various metrics, the associated routes and have the option to roll-back to a previous deployment.
Last updated