@priemskiyyy/simulcast-vue

Vue bindings for simulcast: a provider component that owns the realtime session and composables for shared channel subscriptions, typed events, channel status, and connection state.
606 2
Install
npm install @priemskiyyy/simulcast-vue
Latest Version:0.4.0
Vue:3
License:MIT
Last Updated:Sep 25, 2026
Links: GitHub  ·  npm
Maintainer: priemskiyyy

@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

MIT

Related Packages

@dammers/use-signalr-vue

Fully-typed multi-hub SignalR plugin + composables for Vue.

436 2
@priemskiyyy/simulcast-devtools

Devtools for simulcast: a framework-independent inspector for the realtime conne...

591 2
trpc-nuxt-module

tRPC for Nuxt — a Nuxt module that registers your router's HTTP and WebSocket ha...

784 23
@pushx/vue

Vue.js SDK for pushx.pro real-time messaging

0
@lupinum/better-convex-nuxt

Full-featured Convex integration for Nuxt with SSR, real-time subscriptions, and...

2,088 34

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