Skip to content

brycesteve/nuxtSSE

Repository files navigation

NuxtSSE

npm version npm downloads Nuxt

Nuxt 3 module to simplify using server sent events.

NOTE: I created this for my own personal use, so it may have issues.

Features

  • useServerEventsClient() composable to handle connection to the server automatically.
  • useServerEvents() composable to send events from any server api.
  • Events can be sent to all connected clients, or to an individual client using a custom id

Quick Setup

  1. Add @brycesteve/nuxt-sse dependency to your project
yarn add @brycesteve/nuxt-sse 
# or 
npm install @brycesteve/nuxt-sse
#or
pnpm add @brycesteve/nuxt-sse
  1. Add @brycesteve/nuxt-sse to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    '@brycesteve/nuxt-sse'
  ]
})

That's it! You can now use NuxtSSE in your Nuxt app ✨

Development

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

About

A Nuxt module to simplify using Server Sent Events

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published