[Feat] Add Public Script
Author: Jengro777Created Jul 28, 2026Updated Sep 5, 2026
Describe the solution you'd like
I'd like to see collection-level pre-request scripts (similar to Postman) that can:
- Execute before each request in a collection
- Access request context (URL, method, body, headers)
- Modify request headers/body dynamically
- Read/write environment variables
- Support common crypto libraries (or at least native
crypto.subtle/CryptoJS)
Optionally, a global script that runs for all requests (regardless of collection) would be even more powerful.
Describe alternatives you've considered
Current workarounds I've tried:
- Using environment variables with static values – doesn't support dynamic computation
- Manually generating signatures via browser console and pasting – tedious and breaks workflow
- Switching to Postman/Insomnia – works, but I prefer Hoppscotch's UI and open-source nature
- Using a local proxy (mitmproxy) to inject signatures – overkill for most teams
Example Use Case
I have 20+ endpoints under a collection called Payment Gateway API. Each endpoint requires these headers:
X-Timestamp: 1690000000000
X-Nonce: abc123def456
X-Signature: 3f8a9b2c...
With pre-request scripts, I could:
- Define
SECRET_KEYin environment variables - Write one script at collection level
- All 20+ endpoints automatically get valid signatures
This would save hours of manual work and eliminate copy-paste errors.
Additional Context
- Hoppscotch version: [e.g., 2026.3.0 or self-hosted version]
- Platform: Web / Desktop / Docker
- Related discussions: #1873, #3538 (both closed but relevant)
Source: hoppscotch/hoppscotch