TypeScript SDK client for the QNSP vault-service API. Provides secret management with envelope encryption, versioning, and rotation.
npm install @qnsp/vault-sdkTypeScript client for the QNSP Vault service. Manages secrets with PQC envelope encryption, version
history, rotation policies, and metadata auditing.
``bash`
pnpm add @qnsp/vault-sdk
Provide a service token via apiKey. Vault access is scoped per tenant, so ensure the token mapstier
to the tenant you plan to manage secrets for. Optional lets the SDK fail fast for insufficient
plans.
`ts
import { VaultClient } from "@qnsp/vault-sdk";
const vault = new VaultClient({
baseUrl: "https://vault.qnsp.cuilabs.io",
apiKey: process.env.QNSP_SERVICE_TOKEN!,
tier: "dev-pro",
});
`
| Capability | Minimum tier | Notes |
|------------|--------------|-------|
| Core secret CRUD | dev-pro | Enforced via checkTierAccess("vault", tier) in constructor |dev-pro
| Rotation policies, PQC metadata | | Same requirement |enterprise-standard
| Enclave-backed secret provisioning | | Triggered by backend when enclaves required |
`ts
import { VaultClient } from "@qnsp/vault-sdk";
const vault = new VaultClient({
baseUrl: "https://vault.qnsp.cuilabs.io",
apiKey: process.env.QNSP_SERVICE_TOKEN!,
tier: "dev-pro",
});
const secret = await vault.createSecret({
tenantId: "tenant_123",
name: "db-password",
payload: Buffer.from("super-secret").toString("base64"),
metadata: { env: "prod" },
rotationPolicy: { intervalSeconds: 86_400 },
});
await vault.rotateSecret(secret.id, {
tenantId: "tenant_123",
newPayload: Buffer.from("rotated-secret").toString("base64"),
});
`
Set the telemetry option (or pass config to createVaultClientTelemetry) to emit OTLP spans for eachdocs/observability/portal-dashboards.md
request, including retries and HTTP codes. This data feeds the Vault dashboards in.
- Developer onboarding guide
- SDK inventory
- Tier limits
Licensed under the Apache License, Version 2.0. See LICENSE`.
© 2025 QNSP - CUI LABS, Singapore