Use PartyKit ๐ with Nuxt ๐
Vue port of PartySocket (PartyKit's Client API), powered by VueUse's useWebSocket.
โ๏ธ ย usePartySocket() - Vue PartySocket composable
- Automatically start PartyKit server with Nuxt
Install the module to your Nuxt application with one command:
npx nuxi module add partykit-nuxt
That's it! You can now use partykit-nuxt in your Nuxt app โจ
const { close, data, id, open, send, status, ws } = usePartySocket<string>({
host: 'localhost:1999',
room: 'room',
immediate: false,
autoReconnect: true,
query: {
token: accessToken,
},
})
Local development
# Install dependencies
npm install
# 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