@pinia/nuxt

Nuxt Module for pinia
34,268,649 14,743
Install
npm install @pinia/nuxt
Latest Version:1.0.3
Vue:3
License:MIT
Last Updated:Oct 20, 2026
Links: GitHub  ·  npm
Maintainer: posva

@pinia/nuxt

Nuxt module for Pinia

Automatic Installation

Use nuxi to automatically add this module to your Nuxt project:

npx nuxi@latest module add pinia

Manual Installation

Add dependencies to your Nuxt project:

npm i pinia @pinia/nuxt

Enable the @pinia/nuxt module in nuxt.config.ts:

export default defineNuxtConfig({
  modules: ['@pinia/nuxt'],
})

Configuring the Module

By default, this module adds stores folder to auto imports, in which you can organize code related to Pinia stores in one place.

[!TIP] In the new directory structure introduced since Nuxt 4, this directory is app/stores.

You can customize this behaviour using the pinia property in nuxt.config.ts:

export default defineNuxtConfig({
  modules: ['@pinia/nuxt'],
  // configure the module using `pinia` property
  pinia: {
    /**
     * Automatically add stores dirs to the auto imports. This is the same as
     * directly adding the dirs to the `imports.dirs` option. If you want to
     * also import nested stores, you can use the glob pattern `./stores/**`
     * (on Nuxt 3) or `app/stores/**` (on Nuxt 4+)
     *
     * @default ['stores']
     */
    storesDirs: [],
  },
})

License

MIT

Related Packages

nuxt-spa-store-init

A simple Nuxt module that will hydrate the VueX store when running in SPA mode (...

4,282 14
ee-vuex

More convenient global status manager than Vuex and Pinia

2,452 6
@vaxee/nuxt

Nuxt Module for Vaxee

1,857 74
pinia-logger

Lightweight logger for Pinia

570,548 11
vuex-pathify

Ridiculously simple Vuex setup + wiring

322,817 1,358

Version History

Version Released License
1.0.3 MIT
1.0.2 MIT
1.0.1 MIT
1.0.0 MIT
0.11.3 MIT
Pre-releases (1)
Version Released License
0.5.2-beta.0 MIT