Installation

Learn how to create a NuxtHub project or add it to your current Nuxt project.

Quickstart

The easiest way to get started with NuxtHub is to start with one of our templates. It includes all the necessary configuration and resources to get you started.

Click on the GitHub button, then once on GitHub, click on Use this template to create a new repository based on the template.

Explore NuxtHub templates.

Add to a Nuxt project

  1. Install the NuxtHub module to your project:
Terminal
npx nuxi module add @nuxthub/core-nightly

This command will install @nuxthub/core as dependency and add it to your modules section of your nuxt.config.

That's it! You can now use NuxtHub features in your Nuxt project.

NuxtHub will create a .data directory in your project root, which contains the necessary configuration files and resources for the features to work. It will also add it to the .gitignore file to avoid committing it to your repository.

Options

Configure options in your nuxt.config.ts as such:

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@nuxthub/core'],
  hub: {
    // NuxtHub options
  }
})
blob
boolean | BlobConfig
Default to false - Enables blob storage to store static assets, such as images, videos and more. Set to true for auto-configuration based on your hosting provider (Cloudflare R2, Vercel Blob, AWS S3, etc.), or provide a BlobConfig object with driver and driver-specific options.
cache
boolean | CacheConfig
Default to false - Enables cache storage to cache your server route responses or functions using Nitro's cachedEventHandler and cachedFunction. Set to true for auto-configuration based on your hosting provider, or provide a CacheConfig object with driver and driver-specific options.
db
'postgresql' | 'sqlite' | 'mysql' | DatabaseConfig
Default to false - Enables SQL database to store your application's data. Set to a dialect string ('postgresql', 'sqlite', or 'mysql') for zero-config setup, or provide a DatabaseConfig object with dialect, driver, and connection details.
kv
boolean | KVConfig
Default to false - Enables Key-Value storage to store JSON data. Set to true for auto-configuration based on your hosting provider (Cloudflare KV, Vercel Redis, Deno KV), or provide a KVConfig object with driver and driver-specific options.
dir
string
Default to '.data' - The directory used for storage (database, kv, cache, etc.) during local development.
You're all set! Now, let's dive into deploying it.