# 1Password SDKs 1Password SDKs allow you to build integrations that programmatically interact with 1Password using Go, JavaScript, or Python. With 1Password SDKs, you can: - **Secure your applications**: Load secrets into your code with [secret references](https://developer.1password.com/docs/sdks/load-secrets) or read [environment variables](https://developer.1password.com/docs/sdks/environments/) from 1Password Environments. - **Automate item management**: Programmatically [manage items](https://developer.1password.com/docs/sdks/manage-items) in your 1Password account. - **Securely share items**: [Share items](https://developer.1password.com/docs/sdks/share-items) with anyone, whether or not they have a 1Password account. - **Manage vaults and access**: [Manage your team's vaults](https://developer.1password.com/docs/sdks/vaults) and the [permissions groups have](https://developer.1password.com/docs/sdks/vault-permissions) in them. - **Support biometric authorization**: Build local integrations that users authorize with prompts from the [1Password desktop app](https://developer.1password.com/docs/sdks/concepts#1password-desktop-app) for human-in-the-loop approval and minimal setup for end users. - **Support automated access**: Build integrations that authenticate with [service account tokens](https://developer.1password.com/docs/sdks/concepts#1password-service-account) for least-privilege access and automated environments. See a full list of [supported functionality](https://developer.1password.com/docs/sdks/functionality). ## Supported languages[​](#supported-languages "Direct link to Supported languages") ![Go SDK](https://developer.1password.com/img/logos/go.png)![Go SDK](https://developer.1password.com/img/logos/go.png) [Golang](https://github.com/1Password/onepassword-sdk-go) ![JS SDK](https://developer.1password.com/img/logos/node.png)![JS SDK](https://developer.1password.com/img/logos/node.png) [JavaScript](https://github.com/1Password/onepassword-sdk-js/) ![Python SDK](https://developer.1password.com/img/logos/python.png)![Python SDK](https://developer.1password.com/img/logos/python.png) [Python](https://github.com/1Password/onepassword-sdk-python/) ## Example integrations[​](#example-integrations "Direct link to Example integrations") See examples of how our partners have used SDKs to build integrations with 1Password: **![Go SDK](https://developer.1password.com/img/logos/postman.svg)![Go SDK](https://developer.1password.com/img/logos/postman.svg) [Postman](https://go.pstmn.io/1password)** Securely load API keys and other secrets stored in 1Password into Postman without exposing any secrets in plaintext. [Learn more](https://go.pstmn.io/1password) **![Go SDK](https://developer.1password.com/img/logos/pulumi-light.svg)![Go SDK](https://developer.1password.com/img/logos/pulumi-dark.svg) [Pulumi ESC](https://www.pulumi.com/docs/esc/providers/1password-secrets/)** Dynamically import secrets from 1Password into your environment. The provider will return a map of names to Secrets. [Learn more](https://www.pulumi.com/docs/esc/providers/1password-secrets/) ## About the current version[​](#about-the-current-version "Direct link to 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](https://releases.1password.com/developers/sdks/). ## Get started[​](#get-started "Direct link to Get started") Before you get started, you'll need to [sign up for a 1Password account](https://1password.com/pricing/password-manager). ### Step 1: Decide how you want to authenticate[​](#step-1-decide-how-you-want-to-authenticate "Direct link to Step 1: Decide how you want to authenticate") You can choose between two [authentication methods](https://developer.1password.com/docs/sdks/concepts#authentication) for 1Password SDKs: local authorization prompts from the [1Password desktop app](https://developer.1password.com/docs/sdks/concepts#1password-desktop-app) or automated authentication with a [1Password Service Account](https://developer.1password.com/docs/sdks/concepts#1password-service-account). - **1Password desktop app**: Best for integrations that run locally on a user's machine. Use desktop app authentication if you want minimal setup for end users, human-in-the-loop approval for sensitive workflows, user-specific auditing, if you need access to your full account, or if you need to perform vault management operations. - **Service account**: Best for automated access. Use a service account if you want a token-based authentication method that isn't associated with an individual account to automate access, limit your integration to least privilege access, or for shared building. Service accounts can't access your built-in [Personal](https://support.1password.com/1password-glossary#personal-vault), [Private](https://support.1password.com/1password-glossary#private-vault), or [Employee](https://support.1password.com/1password-glossary#employee-vault) vault. - 1Password desktop app - Service account 1. Install 1Password for [Mac](https://1password.com/downloads/mac), [Windows](https://1password.com/downloads/windows), or [Linux](https://1password.com/downloads/linux). 2. Sign in to the account you want to use with your integration. 3. Select your account or collection at the top of the sidebar, then navigate to **Settings** > **[Developer](onepassword://settings/developers)**. 4. Under Integrate with the 1Password SDKs, select **Integrate with other apps**. 5. If you want to authenticate with biometrics, navigate to **Settings** > **[Security](onepassword://settings/security)**, then turn on the option to unlock using [Touch ID](https://support.1password.com/touch-id-mac/), [Windows Hello](https://support.1password.com/windows-hello/), or [system authentication](https://support.1password.com/system-authentication-linux/). ![The Integrate with other apps setting](https://developer.1password.com/img/sdks/app-integration-setting-full-light.png)![The Integrate with other apps setting](https://developer.1password.com/img/sdks/app-integration-setting-full-dark.png) ### Create a service account Create a [1Password Service Account](https://start.1password.com/developer-tools/infrastructure-secrets/serviceaccount/?source=dev-portal) and give it access to the vaults and [Environments](https://developer.1password.com/docs/environments) you want your integration to be able to access. To allow your integration to update items, make sure to give the service account **both read and write permissions** in the appropriate vaults. To allow your integration to share items, also add the **share permission**. ### Provision your service account token 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 2: Install the SDK[​](#step-2-install-the-sdk "Direct link to Step 2: Install the SDK") Install the SDK in your project. - Go - JavaScript - Python ### Step 3: Import the SDK[​](#step-3-import-the-sdk "Direct link to Step 3: Import the SDK") Import the SDK into your project. - Go - JavaScript - Python #### CommonJS #### ES Modules ### Step 4: Initialize the SDK[​](#step-4-initialize-the-sdk "Direct link to Step 4: Initialize the SDK") When you initialize the SDK, you create a client instance that contains your configuration parameters. For desktop app integrations, you'll need to provide your 1Password account name. For service account authentication, you'll need to provide your service account token. - 1Password desktop app - Service account Replace your-account-name in the code below with your 1Password account name as it appears at the top of the left sidebar in the 1Password app. You can use the account ID that [1Password CLI](https://developer.1password.com/docs/cli/get-started) returns with [`op account list --format json`](https://developer.1password.com/docs/cli/reference/management-commands/account#account-list). Use the value in the `account_uuid` field. Make sure to specify a name and version for your application in place of `My 1Password Integration` and `v1.0.0`. ![The Integrate with other apps setting](https://developer.1password.com/img/sdks/account-name-light.png)![The Integrate with other apps setting](https://developer.1password.com/img/sdks/account-name-dark.png) - Go - JavaScript - Python > **Note** > > > **** > > > > note > > > **Note** > > > > This example prints an error message and exits if initialization fails. Because it writes the error to standard error, it uses Go’s `os` package, which you’ll need to import in your project. See the [complete example in Step 5](#step-5-start-building) for more context. > **Note** > > > **** > > > > note > > > **Note** > > > > The 1Password JavaScript SDK is asynchronous and returns Promises. To make sure your code waits for 1Password to respond before moving to the next line, we recommend using the `await` keyword inside an `async` function. See the [complete example in Step 5](#step-5-start-building) for the full structure. > **Note** > > > **** > > > > note > > > **Note** > > > > The Python SDK is asynchronous. To wait for a response from 1Password, use the `await` keyword inside an `async` function in your code. See the [complete example in Step 5](#step-5-start-building) for the full structure. In the following example, the SDK gets the service account token string from the `OP_SERVICE_ACCOUNT_TOKEN` environment variable. Make sure to specify a name and version for your application in place of `My 1Password Integration` and `v1.0.0`. - Go - JavaScript - Python ### Step 5: Start building[​](#step-5-start-building "Direct link to Step 5: Start building") You can test your setup by building a simple integration that lists all the titles of all the vaults you or the service account has access to. - 1Password desktop app - Service account - Go - JavaScript - Python main.go See result... example.js See result... example.py See result... In the following example, the service account is scoped to a vault titled `Development`. - Go - JavaScript - Python main.go See result... index.js See result... example.py See result... Visit the [Go](https://github.com/1Password/onepassword-sdk-go/tree/main/example), [JavaScript](https://github.com/1Password/onepassword-sdk-js/tree/main/examples), or [Python](https://github.com/1Password/onepassword-sdk-python/blob/main/example/example.py) SDK GitHub repositories for more examples. ## Get help[​](#get-help "Direct link to Get help") To get help with 1Password SDKs, join our [Developer Slack workspace](https://developer.1password.com/joinslack) 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: - [Go](https://github.com/1Password/onepassword-sdk-go/issues/new/choose) - [JavaScript](https://github.com/1Password/onepassword-sdk-js/issues/new/choose) - [Python](https://github.com/1Password/onepassword-sdk-python/issues/new/choose)