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 edge-functions/ directory of your repository, alongside a edge-functions/functions.json manifest. Saving from Studio commits both files to the active branch and deploys the function to Quant.

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.

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 an updated edge-functions/functions.json manifest 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.