Kết quả
No results found.
Phương pháp:
list: () => Promise<Secret[]>
listSync: () => Secret[]
get: (key: string, env?: string, defaultValue?: string) => Promise<string | undefined>
getSync: (key: string, env?: string, defaultValue?: string) => string | undefined
Ví dụ:
// Get list secrets quickly
const secrets = await locker.list()
// or
const secrets = locker.listSync()
// Get a secret value by secret key
// Replace 'ENVIRONMENT' with null or undefined for the enviroment ALL
const secretValue1 = await locker.get('SECRET_NAME_1')
const secretValue2 = await locker.get('SECRET_NAME_2', 'ENVIRONMENT')
const secretValue3 = await locker.get('SECRET_NAME_3', 'ENVIRONMENT', 'default value')
// or
const secretValue3 = locker.getSync('SECRET_NAME_3', 'ENVIRONMENT', 'default value')