Skip to main content

Configure Access Keys

The SDK needs to be configured with your access key which is available in your Locker Secrets Dashboard. Initialize the access_key_id and secret_access_key to its value. You also need to set api_base value (default is https://secrets-core.locker.io). If you need to set your custom headers, you also need to set headers value in the options param:

Per-request configuration

All of the service methods accept an optional RequestOptions object. This is used if you want to pass the access key, headers on each method, or you want set type of return value (default type is string, if you want type of object use IsJson=true)
Now, you can use SDK to get or set values.

List secrets

Use .list() to get all the secrets in your project.

Get secret values

This function will get the secret value by a key. If the key does not exist, SDK will return the default_value

Create secrets

Use the .Create() function to create a new secret:

Update secrets

Use the .Modify() function to update a secret value:

List environments

Use the .List() function to retrieve all environments in your project:

Get environment by name

To retrieve an environment by name, use .Get():

Create an environment

To create a new environment, use .Create():

Update an environment

To update the external_url of an environment by name, use .Modify():