FluxyChat

Ecosystem & CLI

Vue quickstart

Use FluxyChat in Vue 3 with the useChat composable.

Install the Vue package and the core SDK:

npm install @fluxy-chat/vue @fluxy-chat/sdk

Minimal example:

<script setup lang="ts">
import { useChat } from '@fluxy-chat/vue';
import { FluxyChatClient } from '@fluxy-chat/sdk';

const client = new FluxyChatClient({
  baseUrl: import.meta.env.VITE_FLUXYCHAT_WORKER_URL,
  userId: 'user-1',
  token: import.meta.env.VITE_MEMBER_JWT,
});

const { messages, connected, sendMessage } = useChat({
  roomId: 'room-demo',
  client,
});
</script>

<template>
  <p>Status: {{ connected ? 'live' : 'offline' }}</p>
  <ul>
    <li v-for="m in messages" :key="m.id">{{ m.content }}</li>
  </ul>
</template>

The composable mirrors @fluxy-chat/react: same room state, reconnect behavior, and send helpers.