Vue Adapter
@vhyxseal/vue provides composables, headless components, and a Vue plugin for integrating VhyxSeal into Vue 3 applications. The adapter mirrors the React adapter API — developers familiar with the React adapter will find the Vue API immediately familiar.
What the Adapter Provides
- VhyxSealPlugin — Vue plugin (app.use) that installs the contract context
- useSeal() — access manifest and contracts map from any component
- useContract(id) — read a registered contract by component id
- useCapability() — read the full capability map with counts
- useAgentAction() — track agent action lifecycle (standalone, no plugin needed)
- Button, Input, Form, Nav, Display, Confirmation — headless components with contract registration
Installation
Vue ≥ 3.3.0 required.
Full Setup
VhyxSealPlugin Configuration
| Option | Type | Description |
|---|---|---|
| config | ManifestConfig | Required. Same shape as React SealProvider config |
| dev | boolean | Optional. Enable verbose logging and DevTools |
Composables Usage
useSeal() outside plugin context
Important: useSeal() throws a VhyxSealError (not a plain Error) when called outside a component setup() or when called without the plugin installed. This is the correct behavior — it means the component is missing its contract infrastructure. Catch VhyxSealError specifically in error boundaries.
Composables Reference
Component Usage
TypeScript Types
Common Patterns
Form with validation and confirmation
Navigation with active state
Known Limitations
- useSeal() throws VhyxSealError (not raw Error) when called outside plugin — catch specifically
- Vue components are implemented as TypeScript files using defineComponent and h() render functions — not .vue SFC files. The API is identical from the consumer perspective
- Vue devtools integration (separate from @vhyxseal/devtools) is planned for a future release
- useAgentAction() is standalone — it does not require VhyxSealPlugin to be installed