Skip to content

quant function, filter, auth, functions

The Content CLI ships four related commands for managing edge code on QuantCDN: three for deploying individual edge functions (function, filter, auth) and one for deploying multiple at once from a config file (functions).

For an overview of what edge functions are and when to use them, see the Edge Functions docs.

Command Use when
quant function Deploying a single edge function.
quant filter Deploying a single edge filter function (modifies requests/responses).
quant auth Deploying a single edge auth function (authentication/authorisation logic).
quant functions Deploying many functions in one go from a JSON manifest.

Each individual deploy command accepts an optional uuid positional. Pass it to update an existing function in place; omit it to deploy a new function.


Deploy a single edge function.

Terminal window
quant function <file> <description> [uuid] [options]
Name Description
file Path to the function file (required).
description Human-readable description of the function (required).
uuid UUID of an existing function to update. Omit to deploy a new one.
Terminal window
# Deploy a new edge function
quant function handler.js "Homepage personalisation"
# Update an existing function by UUID
quant function handler.js "Homepage personalisation v2" 019361ae-2516-788a-8f50-e803ff561c34

Deploy a single edge filter function. Filter functions run on the request/response path and can modify headers, rewrite URLs, or short-circuit responses.

Terminal window
quant filter <file> <description> [uuid] [options]
Name Description
file Path to the filter function file (required).
description Human-readable description (required).
uuid UUID of an existing filter to update.
Terminal window
# New filter
quant filter filter.js "Strip tracking params"
# Update existing filter
quant filter filter.js "Strip tracking params v2" 019361ae-2516-788a-8f50-e803ff561c34

Deploy a single edge auth function. Auth functions evaluate requests and decide whether they should be allowed through to origin.

Terminal window
quant auth <file> <description> [uuid] [options]
Name Description
file Path to the auth function file (required).
description Human-readable description (required).
uuid UUID of an existing auth function to update.
Terminal window
# New auth function
quant auth auth.js "JWT gate for /admin"
# Update existing auth function
quant auth auth.js "JWT gate v2" 019361ae-2516-788a-8f50-e803ff561c34

Deploy multiple functions in a single command using a JSON manifest. Useful in CI when several functions ship together.

Terminal window
quant functions <file> [options]
Name Description
file Path to the JSON manifest describing the functions to deploy (required).
Terminal window
quant functions functions.json

The manifest is a JSON array. Each entry requires type (function, filter, or auth), path (the source file), and description; uuid is optional and updates an existing function instead of creating a new one:

[
{
"type": "function",
"path": "./functions/handler.js",
"description": "Homepage personalisation"
},
{
"type": "filter",
"path": "./functions/filter.js",
"description": "Strip tracking params",
"uuid": "019361ae-2516-788a-8f50-e803ff561c34"
}
]