insomnia-plugin-global-params

0.1.0 • Public • Published

insomnia-plugin-global-params

Insomnia plugin to add query parameters to all requests.

Getting started

After installing the plugin in your Insomnia settings panel, define an object under the key GLOBAL_PARAMS in your environment as shown in the example below.

{
    "GLOBAL_PARAMS": {
        "account": "my_account"
    }
}

You can validate that the plugin successfully added your params to the resulting URL by right-clicking the request, choosing Copy as cURL, and inspecting your clipboard's contents.

With the environment shown above, a request to GET https://www.example.org/ will result in the following cURL command:

curl --request GET \
  --url 'https://www.example.org/?account=my_account'

This request will not override any parameter defined in the URL or in the Query tab.

For example, a request to GET https://www.example.org/?account=root with the environment shown above will result in:

curl --request GET \
  --url 'https://www.example.org/?account=root'

Disabling the plugin on a per-request basis

If you don't want this plugin to affect a request or a request group, you can right-click the request or request group and choose Disable global params. To enable again, you can select Enable global params instead.

Important: Disabling a request group is simply a bulk action: the group itself has no disabled state. This means if you disable a request group and add a new request to it later, this plugin will be enabled for the new request. Similarly, if you move a request between groups, the request will retain it's disabled state. This is due to a limitation in Insomnia and there's nothing we can do. More specifically, there's no way to retrieve a request's group as it's being filtered by the plugin to determine the group's state.

License

See the included LICENSE file.

Package Sidebar

Install

npm i insomnia-plugin-global-params

Weekly Downloads

2

Version

0.1.0

License

ISC

Unpacked Size

7.05 kB

Total Files

7

Last publish

Collaborators

  • gabrielsoldani