Kong / Kong/insomnia-docs

Improvements for Insomnia Pre-request Script Overview documentation

Open
#245 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
34
Forks
70
PR merge metrics
No merged PRs in 30d

Description

### Code of Conduct

- [x] I have read and agree to the Insomnia Docs project's [Code of Conduct](https://github.com/Kong/insomnia-docs/blob/main/CODE_OF_CONDUCT.md).

### What article on docs.insomnia.rest is affected?

https://docs.insomnia.rest/insomnia/pre-request-script

### What part(s) of the article would you like to see updated?

Variables Manipulation

### Additional information

Hello,

I am writing some scripts for Insomnia collections and found it difficult to understand how variables are evaluated. I would be great to include additional info in the documentation, for example:

1. There are multiple objects that I can use to get variables: `insomnia.environment, insomnia.baseEnvironment, insomnia.variables` - it would be great to have an implicit documentation that would state which object reference which variables (base configuration, collection environment, folder variables).
2. We have multiple levels of configuration, it would be grate do have documentation that states how they are evaluated, is sub-config json merged with the parent config or it override all? Same for collection config and sub configs, directory variables.
3. How to access folder variables and how are they merged in the folder hierarchy. I have collection env with variable `x=col-env-value`, and I also added a folder, on which I created environment variable `x=dir-env-value`. How this folder level variable can be accessed in script? Script is on parent folder, variables on child folder.

Best regards,
Bartek

### Code of Conduct and Community Expectations

- [x] I agree to follow this project's Code of Conduct
- [x] I agree to abide by the Community Expectations

Contributor guide

Open the contributing guide

Research direction

Start with the Variables Manipulation section of the pre-request script article at https://docs.insomnia.rest/insomnia/pre-request-script. Verify how insomnia.environment, insomnia.baseEnvironment, and insomnia.variables expose collection, folder, and base configuration values, including inheritance and merging. Done means the article clearly explains these references, evaluation levels, and folder-variable access.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.