Informative guidance ahead. For protocol requirements see the relevant specification sections.
Before you begin
- A running Vault instance (see Run a Vault locally (Docker))
- Access to the Vault admin capability
Steps
- Create a client capability.
vault-cli capability create \ --scope=read,write \ --resource="vault://messages" \ --label="dev-client" - Configure the client SDK.
import { Client } from '@journalfoundation/vault-sdk'; const client = new Client({ vaultEndpoint: 'https://localhost:8443', capability: process.env.VAULT_CAPABILITY!, }); - Exchange a message.
await client.messages.send({ channel: 'demo', body: 'Hello, encrypted world!', });
Troubleshooting
- Ensure your system clock is accurate; capability tokens are time-bound.
- TLS errors? Import the development CA certificate exported by the Vault container.