@elysia-vue-query/nuxt
v2.0.1
Published
Nuxt module for elysia-vue-query — zero-config SSR dehydration and hydration
Maintainers
Readme
@elysia-vue-query/nuxt
Nuxt module for elysia-vue-query with SSR dehydration and hydration.
Role in the Monorepo
This package is a Nuxt module that provides zero-config integration with @elysia-vue-query/vue. It handles the parts that are tedious to set up manually in a Nuxt application:
- Automatic
VueQueryPluginregistration -- No need to create a Nuxt plugin for TanStack Query. - SSR dehydration / hydration -- Query state is serialized on the server via the
app:renderedhook and rehydrated on the client via theapp:createdhook, using Nuxt'suseStatetransport. - Auto-imports --
createEdenQueryHelpersis available in any component or composable without explicit imports.
Install
bun add @elysia-vue-query/nuxtSetup
// nuxt.config.ts
export default defineNuxtConfig({
modules: ["@elysia-vue-query/nuxt"],
});Then create a composable for your Eden client:
// composables/eden.ts
import { treaty } from "@elysiajs/eden";
import type { App } from "../server";
const client = treaty<App>("http://localhost:3000");
export const eden = createEdenQueryHelpers(client); // auto-importedDocumentation
Full SSR guide, hydration details, and configuration options: elysia-vue-query.github.io/elysia-vue-query/guide/ssr
