Reference
SDK install and examples
Generated SDK install notes and examples for the public API v1 alpha surface.
Install the dependency-free TypeScript ESM client:
npm install @walwarden/sdkimport { createWalwardenClient } from '@walwarden/sdk';
const walwarden = createWalwardenClient({
baseUrl: process.env.WALWARDEN_BASE_URL!,
apiKey: process.env.WALWARDEN_API_KEY!,
userAgent: 'my-service/1.0',
});
const { databases } = await walwarden.listDatabases();Source: GitHub packages/sdk. Package: @walwarden/sdk on npm.
Methods
| SDK method | API operation | Scope | Notes |
|---|---|---|---|
getProfile | getProfile | none | Validate API key profile |
listDatabases | listDatabases | databases:read | List protected databases |
getDatabase | getDatabase | databases:read | Read a protected database |
listDestinations | listDestinations | destinations:read | List backup destinations |
getDestination | getDestination | destinations:read | Read a backup destination |
listDatabaseBackups | listDatabaseBackups | databases:read | List backup jobs for a database |
triggerBackup | triggerBackup | backups:trigger | Trigger an ad-hoc backup |
getBackup | getBackup | databases:read | Read backup job status |
listEvidence | listEvidence | evidence:read | List evidence metadata |
getEvidence | getEvidence | evidence:read | Read evidence detail |
createRestore | createRestore | restores:write | Create restore job |
getRestore | getRestore | restores:read | Read restore job status |
getRecoverySummary | getRecoverySummary | databases:read | Read recovery and custody summary |
getRecoveryCandidate | getRecoveryCandidate | databases:read | Find incident-time recovery candidate |
getRecoveryWindowProof | getRecoveryWindowProof | databases:read | Read recovery-window proof status |
Backup With Evidence Check
const triggered = await walwarden.triggerBackup(databaseId, {
idempotencyKey: crypto.randomUUID(),
trigger: 'adhoc',
});
const completed = await walwarden.pollBackup(triggered.backupJobId, { timeoutMs: 120_000 });
if (completed.state !== 'completed' || !completed.artifact) throw new Error('backup did not produce artifact evidence');
const evidence = await walwarden.listEvidence({ databaseId });
const item = evidence.evidence.find((candidate) => candidate.backupJobId === completed.id);
if (!item?.integrityVerification || item.integrityVerification.result !== 'passed') {
throw new Error('backup does not have passed integrity evidence');
}Do not report recoverability from backup completion alone. Treat evidence as successful only after checking the evidence response semantics.
Restore stays a two-step surface: use createRestore to open a CLI-local execution session and getRestore/pollRestore for status reads. End-to-end execution runs through restore execute on the CLI, which is proven against a live disposable target (E2E run e2e-20260607T1941-8beaa08, audit chain reaching restore.completed; evidence in #320).