Script Library allows you to write reusable code snippets that can be shared across multiple requests, preventing code duplication and making maintenance easier.Managing the Script Library#
To create and manage scripts, go to Settings > Script Library.Using Scripts from the Script Library#
1. Adding to a Request#
In the Pre Processors or Post Processors tab of any request, you can insert a script from the Script Library.Scripts from the Script Library execute before custom scripts in the same processor list.
If multiple scripts are added, they execute in the order they are listed.
2. Calling Functions from Script Library Scripts#
To use a function from a Script Library 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 Script Library 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 Script Library script to your request first, then add a Custom Script below it. Call the function in the Custom Script. Modified at 2026-08-20 03:53:45