Skip to content
Ona Docs

GetSecretValue

client.secrets.getValue(SecretGetValueParams { secretId } body, RequestOptionsoptions?): SecretGetValueResponse { value }
POST/gitpod.v1.SecretService/GetSecretValue

Gets the value of a secret. Only available to environments that are authorized to access the secret.

Use this method to:

  • Retrieve secret values
  • Access credentials

Examples

  • Get secret value:

    Retrieves the value of a specific secret.

    secretId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
ParametersExpand Collapse
body: SecretGetValueParams { secretId }
secretId?: string
formatuuid
ReturnsExpand Collapse
SecretGetValueResponse { value }
value?: string

GetSecretValue

import Gitpod from '@gitpod/sdk';

const client = new Gitpod({
  bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});

const response = await client.secrets.getValue({
  secretId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68',
});

console.log(response.value);
{
  "value": "value"
}
Returns Examples
{
  "value": "value"
}