Skip to main content

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

ChannelParametersReturns
keychain-get-all-KeychainItem[]
keychain-createPartial<KeychainItem>KeychainItem
keychain-updateid, Partial<KeychainItem>KeychainItem
keychain-deleteidboolean

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