otp attribute parameter.
A valid secret reference should use the syntax:
?attribute=otp query parameter to a secret reference that points to a one-time password field in 1Password:
See the examples folder in the 1Password Go, JavaScript, or Python SDK GitHub repository for example code you can quickly clone and test in your project.
Load a secret from 1Password
Replace the placeholder secret reference in the example with a secret reference URI that specifies the vault, item, section (if applicable), and field where the secret is saved in your 1Password account. If you have multiple vaults, items, or fields that share the same name, use a unique identifier instead of the name in the secret reference.- Go
- JavaScript
- Python
resolve function resolves the secret reference and returns the value of the 1Password field it references. You can then use this value in your code, like to authenticate to another service.
Retrieve multiple secrets
You can use thesecrets.resolveAll function to retrieve secrets from 1Password in bulk, improving the performance of the operation.
Replace the placeholder secret references in the example with secret reference URIs that specify the vault, item, section (if applicable), and field where the secrets are saved in your 1Password account.
- Go
- JavaScript
- Python
Validate a secret reference
You can use the secret reference validation function to make sure that your secret reference is formatted correctly.- Go
- JavaScript
- Python