Create a ticket
Sign in Sign up
Locker support Locker support
Results

No results found.

Home Locker Secrets Manager Developer tools Secrets - SDK NodeJS Usages Set up the access key
Vietnamese English
Set up the access key

Set up access key

The SDK needs to be configured with your access key which is available in your Locker Secrets Dashboard. Initialize the accessKeyId and secretAccessKey to their value. You also need to set apiBase value (default value is https://secrets-core.locker.io).

import { Locker } from 'lockerpm'

// You should not hardcode access key credentials. Instead, load them from environment variables
const locker = new Locker({
  accessKeyId: process.env.LOCKER_ACCESS_KEY_ID,
  secretAccessKey: process.env.LOCKER_ACCESS_KEY_SECRET,
  apiBase: '<your base api url>'
})

All initialization options are listed below:

Key
Description
Type
Required
accessKeyId
Your access key id
string
accessKeySecret
Your access key secret
string
apiBase
Your server base API URL, default value is https://api.locker.io/locker_secrets
string
headers
Custom headers for API calls
{[header: string]: string}
unsafe
Set TLS to unsafe if you use a server with self-signed certificate, default value is false
boolean
logLevel
Refer to Logging, default value is 1
number

Now, you can use SDK to get or set values.

Was this page helpful?
No
Yes
Join Our Community