@streetjs/nuxt
v0.1.2
Published
Nuxt 3 plugin + composables for StreetJS, built on @streetjs/vue and @streetjs/client.
Maintainers
Readme
@streetjs/nuxt
Nuxt 3 integration for StreetJS:
re-exports the @streetjs/vue
composables and adds a Nuxt plugin factory that provides a StreetJS client to the
whole app. Vue is a peer dependency; no hard @nuxt/kit dependency.
npm install @streetjs/client @streetjs/vue @streetjs/nuxtQuick start
// plugins/streetjs.ts
import { defineNuxtPlugin } from '#app';
import { createStreetNuxtPlugin } from '@streetjs/nuxt';
export default defineNuxtPlugin(createStreetNuxtPlugin({ baseUrl: '/api', credentials: 'include' }));Then use the composables anywhere:
import { useApi, useAuth, useQuery, useChannel } from '@streetjs/nuxt';
const api = useApi();
const { session, login, logout } = useAuth();The client is also exposed as nuxtApp.$street.
Status:
0.1.xpreview — pre-1.0, APIs may change.
License
MIT
