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 Create new secrets
Vietnamese English
Create new secrets

Methods:

  • create: create a new secret with name, value, environment name (optional), and description (optional). You cannot create secrets with the same key in the same environment. Returns the new secret

create: (data: { key: string; value: string; environmentName?: string; description?: string }) => Promise<Secret>

Example

// Create new secret
const secret1 = await locker.create({
  key: 'key',
  value: 'value',
	description: 'a new secret'
})

// This will throw an Error
const secret2 = await locker.create({
  key: 'key',
  value: 'value 2',
})

// Use another env, this will not throw an Error
const secret3 = await locker.create({
  key: 'key',
  value: 'value',
	environmentName: 'prod'
})

// This will throw an Error
const secret4 = await locker.create({
  key: 'key',
  value: 'value 2',
	environmentName: 'prod'
})
Was this page helpful?
No
Yes
Join Our Community