Dynamic Vault Provisioning
Dynamic vaults let you expose a single feature to customers while Vaultkit quietly provisions a dedicated vault for each end user. This keeps credentials scoped and auditable without leaking internal IDs to your integrators.How it works
- Configure a feature mapping in the Vaultkit dashboard (Dashboard → Feature Mappings) in either static or dynamic mode. Set the feature name, description, providers (for example Gmail, Outlook), and the scopes each provider requires. This metadata is what
FeatureSelectandAuthComponentrender to end users. - Pass the mapping’s ID to the SDK via
featureMappingId. - When
connect()runs, the SDK checks whether a vault already exists for the end user.- If it exists, the SDK reuses it and loads the available tools.
- If not, it calls
POST /api/vaultkit/generate-vault, creates a vault with the permitted providers and scopes, and returns the new ID.
- Tool discovery continues as normal and your agent receives the merged toolset.
Basic implementation
Limiting providers and scopes
Dynamic mappings can allow multiple providers. If you want to capture user intent at runtime (for example GitHub and Slack vs. GitHub only), pass the user’s selection to the SDK.AuthenticationError.
Persisting generated vaults
The SDK exposes everything it learns while provisioning:generated_vault_id in the payload from /api/vaultkit/generate-vault.
Pair with the Feature Selection component
FeatureSelection (exported from @vaultkit/ai-sdk) gives end users a UI for choosing which features and providers to enable. It writes the user’s choices into the shared context so you can feed them into the client before calling connect().
connect() as shown above.