1Password SDKs
1Password SDKs allow you to build secrets management integrations that can programmatically access secrets stored in 1Password using Go, JavaScript, or Python. With 1Password SDKs, you can:
- Securely load secrets from 1Password into your code with secret references.
- Read, write, and update secrets stored in 1Password, including passwords, API keys, and one-time passwords.
- List items and vaults in a 1Password account.
Supported languages
Supported functionality
Feature | Supported functionality | Notes |
---|---|---|
Secret references | You can retrieve secrets from supported field types. | |
Item management | You can perform operations on supported field types. | |
Vault management | ||
Authentication |
About the current version
1Password SDKs are currently in version 0, which means they can meet the stability and scalability requirements of production use cases. During version 0, expect more frequent releases as we add additional features and languages.
- There is a possibility of breaking changes when you upgrade from one version 0 release to another, for example 0.1.X to 0.2.0. Minor releases (0.1.X to 0.1.Y) will not include breaking changes.
- Integration authors may need to update their code when updating the SDK version. Existing code and integrations won’t be affected, as these will have the SDK pinned at a specific version via package.json (JS), requirements.txt (Python), or go.mod (Go).
- We will provide three months of support and security patches for version 0, so you can upgrade when it makes sense for your workflows and teams.
You can find information about the latest releases in the 1Password SDK release notes.
Example integrations
See examples of how our partners have used SDKs to build integrations with 1Password:
Securely load API keys and other secrets stored in 1Password into Postman without exposing any secrets in plaintext.
Learn moreDynamically import secrets from 1Password into your environment. The provider will return a map of names to Secrets.
Learn moreGet started
Before you get started, you'll need to sign up for a 1Password account.
Step 1: Create a service account
Create a 1Password Service Account and give it access to the vaults where the secrets you want to use with the SDK are saved.
To allow the SDK to update items, make sure to give the service account both read and write permissions in the appropriate vaults. To allow the SDK to share items, also add the share permission.
Step 2: Provision your service account token
The SDK uses your service account token to authenticate to 1Password. We recommend provisioning your token from the environment.
Use the following example to provision your token to an environment variable named OP_SERVICE_ACCOUNT_TOKEN
. You can also provision your token in other ways, like by reading it from a file.
- bash, sh, zsh
- fish
- Powershell
Step 3: Install the SDK
Install the SDK in your project.
- Go
- JavaScript
- Python
Step 4: Import the SDK
Import the SDK into your project.
- Go
- JavaScript
- Python
CommonJS
ES Modules
Step 5: Initialize the SDK
When you initialize the SDK, you create a client instance that contains your configuration parameters.
- Go
- JavaScript
- Python
The onepassword.NewClient
function expects a service account token as a parameter. The SDK then uses this token for authentication.
In the following example, the SDK gets the service account token from the OP_SERVICE_ACCOUNT_TOKEN
environment variable using a parameter of the onepassword.NewClient
function.
Make sure to specify a name and version for your application in place of My 1Password Integration
and v1.0.0
.
The CreateClient
function expects a service account token as a parameter. The SDK then uses this token for authentication.
In the following example, the SDK gets the service account token from the OP_SERVICE_ACCOUNT_TOKEN
environment variable using a parameter of the CreateClient
function.
Make sure to specify a name and version for your application in place of My 1Password Integration
and v1.0.0
.
The client.authenticate
function expects a service account token as a parameter. The SDK then uses this token for authentication.
In the following example, the SDK gets the service account token from the OP_SERVICE_ACCOUNT_TOKEN
environment variable using a parameter of the client.authenticate
function.
Make sure to specify a name and version for your application in place of My 1Password Integration
and v1.0.0
.
Step 6: Start building
Now you're ready to start building with the SDK. Visit the Go, JavaScript, or Python SDK GitHub repositories for examples, or learn how to:
Get help
To get help with 1Password SDKs, join our Developer Slack workspace and ask a question in the #sdk
channel.
To request a new feature or report a bug, file an issue in the appropriate GitHub repo: