Skip to content

feat(playground): support safe-mode script libraries in the quickjs sandbox - #56

Draft
sundram-bruno wants to merge 6 commits into
usebruno:mainfrom
sundram-bruno:feat/playground-script-libraries
Draft

feat(playground): support safe-mode script libraries in the quickjs sandbox#56
sundram-bruno wants to merge 6 commits into
usebruno:mainfrom
sundram-bruno:feat/playground-script-libraries

Conversation

@sundram-bruno

Copy link
Copy Markdown
Contributor

Jira: BRU-3838

Description

The docs playground runs collection scripts in a QuickJS sandbox, but the inbuilt script libraries available in the Bruno app were not supported there. Only chai was available, so any script using moment, crypto-js, axios or the other libraries worked in the app but failed in the playground.

Solution

The playground sandbox now supports the same safe mode library set as the Bruno app: axios, moment, crypto-js, jsonwebtoken, uuid, nanoid, chai, tv4, ajv, ajv-formats, buffer, path, btoa and atob. Scripts can use them through require() or the matching globals, exactly like in the app.

Libraries that are only available in the app's developer mode now fail with a clear message instead of a generic one. Pre-request scripts that set their own Authorization header now win over the request's auth config, matching the app. The scripting engine and libraries are lazy loaded, so docs readers who never use the playground do not download any of it.

@sundram-bruno
sundram-bruno force-pushed the feat/playground-script-libraries branch from 32064b1 to 7ddd5c0 Compare August 23, 2026 19:00
@sundram-bruno sundram-bruno changed the title feat(playground): support safe-mode script libraries in the quickjs sandbox (BRU-3838) feat(playground): support safe-mode script libraries in the quickjs sandbox Aug 23, 2026
@sundram-bruno
sundram-bruno marked this pull request as draft August 24, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant