Keychain Module
The keychain module manages user passwords, accounts, and other sensitive information.
Data Structure
interface KeychainItem {
id: string
name: string // Name
url?: string // Associated URL
phone?: string // Phone number
email?: string // Email
password: string // Password
note?: string // Note
createdAt: string
updatedAt: string
}
IPC Channels
| Channel | Parameters | Returns |
|---|---|---|
keychain-get-all | - | KeychainItem[] |
keychain-create | Partial<KeychainItem> | KeychainItem |
keychain-update | id, Partial<KeychainItem> | KeychainItem |
keychain-delete | id | boolean |
Usage in Metaverse
const api = getWtElectronAPI()
// Load all keys
const items = await api.keychain.getAll()
// Create
await api.keychain.create({
name: 'GitHub',
url: 'https://github.com',
password: 'xxxxx',
})
// Update
await api.keychain.update(id, { name: 'New Name' })
// Delete
await api.keychain.remove(id)
Features
- Password masking (••••••••)
- One-click field copy
- Search filtering
- Expandable details