Tạo yêu cầu hỗ trợ
Đăng nhập Đăng ký
Locker support Locker support
Kết quả

No results found.

Trang chủ Locker Secrets Manager Developer tools Secrets - SDK NodeJS Usages Cài đặt access key
Vietnamese English
Cài đặt access key

SDK cần được cấu hình với khóa truy cập của bạn, khóa này có sẵn trong Bảng điều khiển Locker Secret của bạn. Khởi tạo secret_access_key thành giá trị của nó. Bạn cũng cần thiết lập giá trị api_base (mặc định là https://api.locker.io/locker_secrets).

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>'
})

Tất cả các tuỳ chọn khởi tạo được liệt kê dưới đây:

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

Bây giờ, bạn có thể sử dụng SDK để lấy hoặc đặt các giá trị.

Trang này có hữu ích với bạn??
Không
Tham gia cộng đồng của chúng tôi