libs/tools/export) provides comprehensive vault export functionality for Bitwarden. This library enables users and organizations to export their vault data in various formats for backup, migration, or compliance purposes.
Overview
The Export library is organized undervault-export and contains two main packages:
- @bitwarden/vault-export-core - Core export logic, types, and services
- @bitwarden/vault-export-ui - Angular UI components for vault export
- Web Vault
- Desktop Application
- Browser Extension
- CLI
Architecture
The export library follows a service-oriented architecture with separate implementations for individual vaults and organization vaults.Core Services
Located inlibs/tools/export/vault-export/vault-export-core/src/services/
VaultExportServiceAbstraction
File:vault-export.service.abstraction.ts
Main service interface for vault exports.
Methods:
IndividualVaultExportService
File:individual-vault-export.service.ts
Handles exports for individual user vaults, including ciphers, folders, and attachments.
Key Methods:
BaseVaultExportService and handles:
- Folder decryption and export
- Cipher decryption and export
- Attachment handling
- Format conversion (CSV, JSON, encrypted JSON)
Export Formats
The library supports four export formats:CSV Format
Format:"csv"
Exports vault data as comma-separated values. Suitable for spreadsheet applications and basic backups.
Includes:
- Folders
- Logins
- Cards
- Identities
- Secure notes
- No attachments
- No custom fields (in some cases)
- Limited metadata
JSON Format
Format:"json"
Exports vault data as unencrypted JSON. Contains complete vault structure with all metadata.
Includes:
- All cipher data
- Folders and collections
- Custom fields
- Attachments (metadata only)
- Full metadata (creation dates, revision dates, etc.)
Encrypted JSON Format
Format:"encrypted_json"
Exports vault data as password-protected, encrypted JSON. Most secure export option.
Features:
- Password-based encryption
- Complete vault data
- Maintains encryption at rest
- Suitable for secure backups
- Uses account’s KDF settings (PBKDF2, Argon2)
- Generates unique encryption key from password
- All sensitive data remains encrypted
ZIP Format
Format:"zip"
Exports vault as a ZIP archive containing JSON export plus attachments.
Includes:
- JSON vault export
- All cipher attachments
- Folder structure for attachments
- Complete backup with files
- Migration with attachments
- Archival purposes
Export Types
Located inlibs/tools/export/vault-export/vault-export-core/src/types/
ExportedVault
Union type representing any exported vault format:BitwardenUnEncryptedIndividualJsonExport
Structure for unencrypted JSON exports:BitwardenEncryptedIndividualJsonExport
Structure for encrypted JSON exports:Usage Examples
Export Individual Vault as JSON
Export with Password Protection
Export Organization Vault
Get Available Export Formats
Export Helpers
ExportHelper
File:export-helper.ts
Utility class for common export operations:
- CSV generation using PapaParse
- JSON formatting
- ZIP archive creation using JSZip
- File attachment handling
- Data sanitization
Security Considerations
Unencrypted Exports
Formats: CSV, JSON- Data is exported in plain text
- No encryption at rest
- Should be stored securely
- Recommended for immediate import only
- Delete after use
Encrypted Exports
Format: Encrypted JSON- Password-based encryption
- Uses user’s KDF settings
- Secure for long-term storage
- Requires password to import
- Resistant to brute force attacks
Best Practices
- Use encrypted exports for backups
- Use strong passwords for encrypted exports
- Store exports securely (encrypted drives, secure cloud storage)
- Delete unencrypted exports after immediate use
- Verify exports before deleting vault data
- Limit export access in organizations
Export Restrictions
Organization Policies
Organizations can restrict exports:- Disable personal vault export
- Disable organization vault export
- Require password-protected exports
- Audit export activities
User Permissions
Export permissions vary by role:- Owner/Admin - Full export access
- User - Personal vault only
- Custom roles - Configurable permissions
Integration Example
Complete Export Workflow:Related
- Generator Library - Password and credential generation
- Send Library - Secure sharing functionality