@priemskiyyy/simulcast-vue
| Install | |
|---|---|
npm install @priemskiyyy/simulcast-vue |
|
| Latest Version: | 0.4.0 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Sep 25, 2026 |
| Links: | GitHub · npm |
@priemskiyyy/simulcast-vue
Vue bindings for simulcast. The provider component owns the session; composables share channel subscriptions and expose state as refs.
pnpm add @priemskiyyy/simulcast @priemskiyyy/simulcast-vue
<script setup lang="ts">
import { useChannel, useChannelStatus } from "@priemskiyyy/simulcast-vue";
const props = defineProps<{ roomId: string }>();
type Message = { id: string; text: string };
const status = useChannelStatus(() => `rooms:${props.roomId}`);
useChannel<Message>(
() => `rooms:${props.roomId}`,
(message) => {
console.log(message.text);
},
);
</script>
<template>
<p>{{ status.state }}</p>
</template>
<RealtimeProvider :client="realtime" :session="{ id: currentUser.id }">
<Room :room-id="roomId" />
</RealtimeProvider>
Channels accept a value, a ref, or a getter and resubscribe when they change. useChannelStatus and useConnectionState return readonly shallow refs. useRealtimeClient returns the provider's client as a ref, including native for provider-specific APIs. Subscriptions start after mount, so server rendering opens nothing and hydrates from disconnected and detached.
| Composable | Purpose |
|---|---|
useChannel(channel, handler, options?) |
Receive publications; optionally parse their data. enabled may be a ref. |
useChannelStatus(channel) |
Observe subscription state and the latest error without opening a subscription. |
useConnectionState() |
Read disconnected, connecting, or connected. |
useRealtimeClient() |
The provider's client as a ref. |
createChannelEventHooks<Events>() maps event names to channel and payload types. Providers with named events need no decoder.
License
Related Packages
Devtools for simulcast: a framework-independent inspector for the realtime conne...
tRPC for Nuxt — a Nuxt module that registers your router's HTTP and WebSocket ha...
Full-featured Convex integration for Nuxt with SSR, real-time subscriptions, and...
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.4.0 | >=3.5.0 <4 | MIT | |
| 0.3.0 | >=3.5.0 <4 | MIT | |
| 0.2.0 | >=3.5.0 <4 | MIT | |
| 0.1.0 | >=3.5.0 <4 | MIT |