Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@1password/sdk

Package Overview
Dependencies
Maintainers
0
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@1password/sdk

The 1Password JavaScript SDK offers programmatic read access to your secrets in 1Password in an interface native to JavaScript. The SDK currently supports `Node.JS`

  • 0.1.5
  • latest
  • stable
  • npm
  • Socket score

Version published
Weekly downloads
15K
increased by16.66%
Maintainers
0
Weekly downloads
 
Created
Source

1Password JavaScript SDK

Build integrations that programmatically access your secrets in 1Password.

Documentation | Examples


🚀 Get started

To use the 1Password JavaScript SDK in your project:

  1. Create a service account and give it the appropriate permissions in the vaults where the items you want to use with the SDK are saved.

  2. Provision your service account token. We recommend provisioning your token from the environment. For example, to export your token to the OP_SERVICE_ACCOUNT_TOKEN environment variable:

    macOS or Linux

    export OP_SERVICE_ACCOUNT_TOKEN=<your-service-account-token>
    

    Windows

    $Env:OP_SERVICE_ACCOUNT_TOKEN = "<your-service-account-token>"
    
  3. Install the 1Password JavaScript SDK in your project:

    ## NPM
    npm install @1password/sdk
    
    ## PNPM
    pnpm add @1password/sdk
    
    ## Yarn
    yarn add @1password/sdk
    
  4. Use the JavaScript SDK in your project:

import { createClient } from "@1password/sdk";

// Creates an authenticated client.
const client = await createClient({
  auth: process.env.OP_SERVICE_ACCOUNT_TOKEN,
  // Set the following to your own integration name and version.
  integrationName: "My 1Password Integration",
  integrationVersion: "v1.0.0",
});

// Fetches a secret.
const secret = await client.secrets.resolve("op://vault/item/field");

Make sure to use secret reference URIs with the syntax op://vault/item/field to securely load secrets from 1Password into your code.

Inside createClient(), set integrationName to the name of your application and integrationVersion to the version of your application.

Supported functionality

1Password SDKs are in active development. We're keen to hear what you'd like to see next. Let us know by upvoting or filing an issue.

Item management

Operations:

Field types:

  • API Keys
  • Passwords
  • Concealed fields
  • Text fields
  • Notes
  • SSH private keys (partially supported: supported in resolving secret references, not yet supported in item create/get/update)
  • SSH public keys, fingerprint and key type
  • One-time passwords
  • URLs
  • Websites (used to suggest and autofill logins)
  • Phone numbers
  • Credit card types
  • Credit card numbers
  • File attachments and Document items

Vault management

  • Retrieve vaults
  • Create vaults (#50)
  • Update vaults
  • Delete vaults
  • List vaults

User & access management

  • Provision users
  • Retrieve users
  • List users
  • Suspend users
  • Create groups
  • Update group membership
  • Update vault access & permissions

Compliance & reporting

Authentication

📖 Learn more

FAQs

Package last updated on 03 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc