feat(playground): support safe-mode script libraries in the quickjs sandbox - #56
Draft
sundram-bruno wants to merge 6 commits into
Draft
feat(playground): support safe-mode script libraries in the quickjs sandbox#56sundram-bruno wants to merge 6 commits into
sundram-bruno wants to merge 6 commits into
Conversation
sundram-bruno
force-pushed
the
feat/playground-script-libraries
branch
from
August 23, 2026 19:00
32064b1 to
7ddd5c0
Compare
sundram-bruno
marked this pull request as draft
August 24, 2026 10:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.