Skip to content

Can't create client in AWS Lambda environment #167

@tobiberger

Description

@tobiberger

Scenario & Reproduction Steps

I'm trying to use the 1Password SDK in an AWS Lambda function. My code works fine locally, but in the Lambda environment, it fails to create the 1Password SDK client (more details below).

I'm using SDK version 0.3.1 in Node 24. Locally I'm running on an ARM architecture (Apple Silicon), I tried it in AWS Lambda with both arm64 and x86_64 runtimes.

Actual Behavior

No issue when running locally (accessing 1Password works fine).
In the AWS Lambda environment, the call to createClient rejects with the following error:

{
  "errorType": "Error",
  "errorMessage": "authentication error: you don't have the right permissions to access this resource",
  "trace": [
    "Error: authentication error: you don't have the right permissions to access this resource",
    "    at throwError (/var/task/node_modules/@1password/sdk/dist/errors.js:24:19)",
    "    at SharedCore.<anonymous> (/var/task/node_modules/@1password/sdk/dist/core.js:31:41)",
    "    at Generator.throw (<anonymous>)",
    "    at rejected (/var/task/node_modules/@1password/sdk/dist/core.js:6:65)",
    "    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)"
  ]
}

Expected Behavior

I can create and use the SDK client in AWS Lambda

SDK version

@1password/[email protected]

Additional information

Here I have a little reference implementation to reproduce the error. I just installed the npm-dependencies and uploaded the whole directory as Lambda code (no bundling or anything).
https://github.com/tobiberger/1password-sdk-lambda-error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions