Public Scripts allow you to write reusable code snippets that can be shared across multiple requests, preventing code duplication and making maintenance easier.Managing Public Scripts#
To create and manage scripts, go to Settings > Public Scripts.Using Public Scripts#
1. Adding to a Request#
In the Pre Processors or Post Processors tab of any request, you can insert a Public Script.Public scripts executes before custom scripts in the same processor list.
If multiple public scripts are added, they execute in the order they are listed.
2. Calling Functions from Public Scripts#
To use a function from a Public Script inside a Custom Script, the function must be declared as global.Bad Practice (Local Scope):Good Practice (Global Scope):1
Define Global FunctionIn your Public Script, define the function without var, let, or const, or explicitly attach it to window/global if needed (though direct assignment usually works in PM sandbox). 2
Call in Custom ScriptAdd the Public Script to your request first, then add a Custom Script below it. Call the function in the Custom Script. Modified atΒ 2026-01-14 09:10:00