A plugin for [Insomnia]( which automatically fetches a token from the Lagoon GraphQL API, in the [manner described in the docs](

Downloads in past


000.2.85 months ago6 months agoMinified + gzip package size for insomnia-plugin-lagoon-token in KB


Lagoon token
A plugin for Insomnia which automatically fetches a token from the Lagoon GraphQL API, in the manner described in the docs.


  • Use this in a browser insomnia://plugins/install?name=insomnia-plugin-lagoon-token
  • Open Insomnia, Click on the Cog Top Right, Click Plugins and use insomnia-plugin-lagoon-token as the Package to install
  • Find this plugin on the Insomnia Plugins list instead!

In case there's an error when installing as above, go into the plugins directory and run npm install insomnia-plugin-lagoon-token manually.


  1. Create an environment and set the Lagoon GraphQL API endpoint:
    "lagoon_graphql_url": ""
  1. If you have already set up your ~/.ssh/id_ed25519 or ~/.ssh/id_rsa to talk to Lagoon, skip to step 4.

  1. Create an Environment using the following template:
    "lagoon_graphql_url": "",
    "lagoon_graphql_token": "[your-token]", # Not required nor recommended.
    "lagoon_ssh_host": "",
    "lagoon_ssh_port": 32222,
    "lagoon_ssh_private_key": "/your/user/home/.ssh/id_ed25519"
  1. Create a request with url {{ _.lagoon_graphql_url }} and set the environment created in step 1. Make sure to check Enabled in the Bearer tab, but leave the TOKEN empty.
The plugin will fetch the token (**when `lagoon_graphql_token` is not provided**) and add it as a bearer token to the header. The `Content-Type` header is also set to `application/json` automatically.
  1. Profit.


The plugin expects the following variables in the environment:
  • lagoongraphqlurl:
- Description: The GraphQL endpoint for the Lagoon instance. - Required: Yes - Default^1:
  • lagoongraphqltoken
- Description: A manually provided token. If this is provided, tokens won't be fetched nor renewed, and it overrides the SSH options. - Required: No - Default: - - Note: We highly recommend not using this option as the token will either be short-lived and you will have to manually update it yourself when it expires, or long-lived for a service account, which might pose a security risk. Use the SSH options instead (which is the default).
  • lagoonsshhost
- Description: The Lagoon SSH host for fetching the token. - Required: No - Default^1:
  • lagoonsshport
- Description: The Lagoon SSH port. - Required: No - Default^1: 32222
  • lagoonsshprivatekey
- Description: The private key to use for SSH; this should have already been added to your user in the Lagoon UI^2. - Required: No - Default: /your/user/home/.ssh/id_ed25519 or /your/user/home/.ssh/id_rsa