Database
Sanvex core ships five migrations that createsv_* tables. With sanvex/core installed, run:
Tables
sv_accounts
Stores encrypted credentials per driver and owner.
Unique constraint:
(owner_type, owner_id, driver, key_name).
This is where sanvex:setup writes tokens.
sv_entities
Cached or synced entities from external services.
Unique constraint:
(owner_type, owner_id, driver, entity_type, entity_id).
Drivers expose local DB access via $driver->db() (e.g. db()->repositories()).
sv_events
Webhook and event log.
sv_permissions
Approval records for guarded actions.
Approval URL is configured via
SANVEX_APPROVAL_URL (default /sanvex/approve).
sv_integrations
This table is created by migration but is not read or written by current core/driver runtime code. Treat it as reserved for future use.
Encryption
Credentials insv_accounts are encrypted at rest:
- A random DEK (data encryption key) encrypts the credential value
- The DEK is encrypted with the KEK (key encryption key)
- KEK comes from
SANVEX_KEKin.env, falling back toAPP_KEY
.env:
KeyManager is configured (no KEK), credentials are held in memory only and not persisted.