A plugin to retrieve secrets from your 1Password Vault.
Even though Insomnia can be configured to be end-to-end encrypted I still don't like to have my secrets stored in plain text. In addition, Insomnia would be another place where I'd need to keep my secrets within environment variables in sync (e.g. if I change a password).
Using the Plugin system from Insomnia secrets can safely be retrieved from a 1Password Vault authenticating via e.g. biometrics.
- Install the 1Password CLI.
- Install the plugin from the Insomnia Plugin Hub
If you install the 1Password CLI via a package manager (like Homebrew), then you need to tell the plugin the path to the CLI.
Add the plugin config into your base environment (replace or remove the account name to use the default 1Password account):
{
"__op_plugin": {
"cliPath": "/opt/homebrew/bin/op",
"defaultAccount": "team-name.1password.com"
}
}
If you need to set any global flags, add the following:
{
"__op_plugin": {
"flags": {
// For example specify the account to use
"account": "example.1password.com",
}
}
}
-
Hit
Ctrl + Space
and select the1Password => Fetch Secret
action. -
Click on the action and paste a reference to your 1Password Secret.
-
Add a custom account name, or leave empty to use the default account.
As an alternative, you can also add the secret reference to your environment variables and reference this variable inside the action.
Due to the fact that Insomnia retrieves the values every time when you e.g. hover over a variable
the plugin uses node-cache
to cache secrets for one hour. If you want to purge the cache,
restart Insomnia.