[GH-ISSUE #2140] [feature]: Would like access to btoa and atob functions from the pre-request script environment. #722

Closed
opened 2026-03-16 16:52:27 +03:00 by kerem · 3 comments
Owner

Originally created by @frenchtoastbeer on GitHub (Feb 28, 2022).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2140

Is there an existing issue for this?

  • I have searched the existing issues

Summary

Like the title suggests, make base64 encoding and decoding available to the pre-request scripting environment.

Why should this be worked on?

I confess I am unaware if btoa is in the ecmascript standard or not, but seeing as how its been in every execution environment I ever tried to use it in, I was surprised when it wasn't available here.

Originally created by @frenchtoastbeer on GitHub (Feb 28, 2022). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2140 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Summary Like the title suggests, make base64 encoding and decoding available to the pre-request scripting environment. ### Why should this be worked on? I confess I am unaware if btoa is in the ecmascript standard or not, but seeing as how its been in every execution environment I ever tried to use it in, I was surprised when it wasn't available here.
kerem 2026-03-16 16:52:27 +03:00
Author
Owner

@Chinoman10 commented on GitHub (Jan 19, 2024):

Been trying to use some combination of Buffer/CryptoJS, btoa and even seeing if it's somehow possible to import libraries into the pre-request scripts of Hoppscotch...
1h later I found this issue (Google has indeed been losing qualities...); sad that you can't do base64 encoding/decoding, but I'm happy there's a PR already made to add these functions in.

<!-- gh-comment-id:1900731766 --> @Chinoman10 commented on GitHub (Jan 19, 2024): Been trying to use some combination of Buffer/CryptoJS, btoa and even seeing if it's somehow possible to import libraries into the pre-request scripts of Hoppscotch... 1h later I found this issue (_Google has indeed been losing qualities..._); sad that you can't do base64 encoding/decoding, but I'm happy there's a PR already made to add these functions in.
Author
Owner

@marisly commented on GitHub (Mar 26, 2024):

Hello, thanks for developing the feature..
Could you please help with example of usage of a function?
WIll it be smth:
pw.env.set("btoa", btoa( "smth" ))

<!-- gh-comment-id:2021091944 --> @marisly commented on GitHub (Mar 26, 2024): Hello, thanks for developing the feature.. Could you please help with example of usage of a function? WIll it be smth: pw.env.set("btoa", btoa( "smth" ))
Author
Owner

@liyasthomas commented on GitHub (May 1, 2024):

Thanks for your patience and valuable feedback. This feature has been implemented in a previous release candidate.

Closing this ticket as this feature is now available in the recent version. Please feel free to reach out if you have any other concerns.

<!-- gh-comment-id:2088163613 --> @liyasthomas commented on GitHub (May 1, 2024): Thanks for your patience and valuable feedback. This feature has been implemented in a previous release candidate. Closing this ticket as this feature is now available in the recent version. Please feel free to reach out if you have any other concerns.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#722
No description provided.