- Request with the SDK, fill with the extension. Your code asks for access before a browser or tab exists, and the extension fills when the agent reaches the sign-in page. Your code never receives a value.
- Read with the SDK. Your code receives the values. Your application becomes responsible for handling them safely and for how they’re used, including filling them into a page.
Install
The SDK is published as a developer preview. It needs Node.js 18 or later.Create a client
Every call takes two credentials: the person’s current access token, and the integration key from their connection. See Connect a user.- The client exposes only
client.credentialBroker. The items, vaults, and secrets APIs belong to other client types and aren’t available with OAuth credentials. - The client is bound to the access token you passed in. Access tokens expire after 15 minutes. When you refresh, create a new client.
- The client sends every request to the API host named in the integration key, so a key issued on 1password.com talks to
api.1password.com. There’s no host setting. If your network restricts outbound traffic, allow that host.
Create an access request
accessRequest.id to check status, each entries[].id to match grants to entries, and the whole object to build the approval link.
Send the person to approval
The SDK doesn’t return an app link yet. Build it from the returned request, then deliver it to the person’s device:Wait for the decision
getStatus returns the current status immediately. Loop until the state isn’t pending:
getStatus takes the request id, not its path. resolved, denied, and failed are final. If your loop times out, the request may still be pending; the timeout doesn’t mean the request failed.
Read a granted login
- Pass
granted.referenceunchanged. It’s an object,{ reference: "accounts/.../capability/login/configurations/..." }, and the read methods take the object, not the string inside it. totpis the current one-time password, computed when you read.- Every read is a fresh call to 1Password. Read again when you need the value, rather than caching it. After the grant ends, the next read fails instead of returning a stale value.
- Keep values out of logs, prompts, and model context, and discard them as soon as they’re used.
Request with the SDK and fill with the extension
Switching from the SDK to the extension doesn’t require a new request. Keep the request ID, entry IDs, and granted references, and pass them to the part of your system that drives the browser. When the agent reaches the sign-in page, wait for the extension to initialize, turn on Agentic Mode for the tab or the whole browser, then callapi.agenticAutofill.v1.fillCredential with the string inside the reference object, granted.reference.reference, as resourcePath. The SDK’s read methods take the object, and the extension takes the string inside it. Use the same person’s access token and integration key that created and resolved the request.
Reference
Promise<OAuthClient>
Creates a client from
{ accessToken, integrationKey }.Promise<AccessRequest>
Registers an access request.
params is { goal?, entries }, with 1 to 5 entries of { type, parameters: { website }, reason?, keywords? }. Returns the full request: path, id, identity, state, createdAt, goal, and entries with their IDs.Promise<AccessRequestStatus>
Returns
{ state, resolved }. state is pending, resolved, denied, or failed. resolved lists { entryId?, reference: { reference } } for each granted login, and is empty for every other state.Promise<LoginDetails>
Returns
{ websites }, the non-secret details of a granted login.Promise<LoginCredential>
Returns
{ username?, password?, totp? } for a granted login.Errors
The SDK rejects its promises on failure, so wrap calls intry and catch. The developer preview doesn’t export typed error classes for these failures, so don’t use instanceof checks. Match on the message.