Alva
Alva (Ash Live Vue Adapter) is an Ash Extension and Phoenix LiveView adapter that securely bridges your Elixir backend with a Vue 3 frontend.
It completely eliminates the need for manual API routing, REST endpoints, or GraphQL resolvers. By directly connecting Ash Resources to LiveVue, Alva auto-generates a fully typed TypeScript SDK that lets you execute actions, read streams, process uploads, and listen to PubSub signals from the frontend — all with end-to-end TypeScript safety over LiveView WebSockets.
Installation
Add alva to your list of dependencies in mix.exs:
def deps do
[
{:alva, "~> 0.1.0"}
]
end
Then run mix deps.get.
Quick Start
Configure Ash Resources with the
Alva.Resourceextension and define events:defmodule MyApp.Catalog.Product douse Ash.Resource,extensions: [Alva.Resource]alva doevent(:catalog_list_products,name: "catalog.list_products",action: :list)endactions doread :list dopublic?(true)endendendInject
Alva.LiveViewinto your LiveView:defmodule MyAppWeb.StorefrontLive douse MyAppWeb, :live_viewuse Alva.LiveView, streams: [...]endRun the code generator to produce TypeScript bindings:
mix alva.codegenUse the generated SDK in your Vue 3 frontend:
const alva = useAlva();const result = await alva.catalog.list_products({});
Documentation
See the guides for detailed walkthroughs:
- Getting Started
- Ash Backend Setup
- LiveView Integration
- Queries and Actions
- Forms and Mutations
- Frontend Composables
- Uploads
- Streams
- Signals
Full API reference is available at https://hexdocs.pm/alva.