@meistrari/vault-sdk
v3.3.0
Published
TypeScript SDK for interacting with the Vault file storage service. It supports file upload, download, streaming uploads, file hierarchies, public assets, permalinks, and vault reference utilities.
Maintainers
Keywords
Readme
Vault SDK
TypeScript SDK for interacting with the Vault file storage service. It supports file upload, download, streaming uploads, file hierarchies, public assets, permalinks, and vault reference utilities.
Use the SDK when an application needs to store private files in Vault, publish stable public asset URLs such as avatars or logos, or keep durable vault:// references instead of temporary presigned URLs.
Installation
bun add @meistrari/vault-sdkQuick Start
import { vaultClient, DataTokenAuthStrategy } from '@meistrari/vault-sdk'
const client = vaultClient({
vaultUrl: 'https://vault.tela.com',
authStrategy: new DataTokenAuthStrategy('[your-data-token]'),
})
const vaultFile = await client.createFromContent(
new File(['Hello World'], 'hello.txt'),
{ upload: true },
)
console.log(vaultFile.getVaultReference())For a more detailed usage guide, see the SDK guides.
Guides
Main Exports
The package exports vaultClient, VaultFile, VaultAsset, Permalink, DataTokenAuthStrategy, APIKeyAuthStrategy, and vault reference utility functions.
