Skip to content

Edge functions

Studio includes an in-browser editor for edge functions. From the Edge Functions screen (the file-out icon in the Studio nav rail) you can create, edit, rename, and delete functions that run on the Quant edge.

Functions are stored as JavaScript files in the quant/edge-functions/ directory of your repository, with a quant/edge-functions.json manifest next to that directory. Saving from Studio commits both files to the active branch and deploys the function to Quant.

A repository that Studio set up before this layout keeps its functions in edge-functions/ with an edge-functions/functions.json manifest. Studio still reads and writes that path. If both manifests exist, quant/edge-functions.json is used.

Each manifest entry has a uuid, which is the function’s identity. Studio creates a new version 4 UUID when you create a function, and keeps it when you edit, rename or redeploy the function. Do not change the uuid in the manifest: a new UUID deploys a new function, and Islands and rules that name the old UUID (function_uuid) stop matching.

Studio publish checks each manifest entry with the same rules as the Content CLI and the GitHub deploy action. An entry without a valid uuid is not deployed, and the Deployments page names it. The other entries still deploy. (The CLI and the deploy action refuse the whole manifest instead.)

When you click New, Studio prompts you to choose a type. Each type starts the editor with a different template:

Type What it does
Function Handles a request and returns a custom response.
Filter Transforms response content as it streams through.
Auth Acts as authentication middleware for protected routes. Return status 201 to let the request continue.

The list view shows every function from the manifest. Each card displays a type badge, the function’s description (or its path if no description is set), and the file path. From each row you can:

  • Click the row — open the function in the editor.
  • Rename (pencil icon) — change the file’s slug. Studio commits the rename and updates the manifest.
  • Delete (trash icon) — remove the function from the manifest, delete the file, and unpublish the function from Quant.

Click New in the toolbar to create a new function.

Selecting a function opens a split-pane view with a Monaco code editor on the left and a preview pane on the right.

Control Description
Back Return to the function list.
Type badge Shows the current function type.
Description field Inline-editable description that becomes the function’s display name.
Run Execute the function against a sandboxed preview endpoint and render the response in the preview pane.
Preview Toggle the preview pane on or off.
Save & Deploy Commit the file to your repository on the active branch and deploy to Quant.
  • Cmd/Ctrl+S — Save and deploy the current function.

When you click Save & Deploy, Studio:

  1. Generates a filename from the description if the function is new.
  2. Commits the function file and the updated manifest (quant/edge-functions.json, or the earlier edge-functions/functions.json) to the active branch in a single commit.
  3. Deploys the function to Quant via the user API.

If the deployment step fails after a successful commit, the file is still saved in your repository and the error is reported in the editor.

The Studio AI assistant is context-aware while you are in the edge function editor. Opening the assistant from this screen attaches the current function’s type, file path, description, and UUID to the conversation.

If the assistant returns code changes, Studio switches the editor into a diff review mode that shows the original and proposed code side by side. You can:

  • Accept — replace your code with the assistant’s version.
  • Reject — keep your original code.