mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #4896] [feature]: Add option to scripts to save variables in Global Environment #1841
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#1841
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @emanuel-achirei-deel on GitHub (Mar 17, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4896
Is there an existing issue for this?
Summary
I'm using Tests to generate variable values to use in a subsequent request. Currently I'm saving using
pw.env.set. However, this saves them in the Workspace Environment, which makes them shared accross users, and this could create issues if those requests are run in parallel by different users.Why should this be worked on?
The use-case is generating a signed URL for S3 and then uploading a file. I'm sure there are other cases like this one. I've seen other solutions, where you can directly reference the value from a response in the request parameters, but given that might be more difficult to implement, an option to choose which environment to set when calling pw.env.set might be a good middle ground.
@jamesgeorge007 commented on GitHub (Oct 3, 2025):
Hi, we've introduced a
hoppnamespace housing new scripting methods as proposed in https://github.com/hoppscotch/hoppscotch/discussions/5221 with the ability to manage global environment variables from the scripting context.It's not recommended to migrate or rework your existing scripts for the new scripting APIs just yet. Breaking changes are expected as the system evolves.
The rollout is intentionally gradual to gather feedback and refine based on real-world use. All future changes will be scoped to the experimental scripting sandbox (enabled by default; can be toggled in
Settings → Experiments). Please feel free to take it for a spin and let us know your feedback via the RFC above.