Installation
Quickstart
The easiest way to get started with NuxtHub is to use our template. It includes all the necessary configuration and resources to get you started with NuxtHub.
Click on Use this template
on github.com/nuxt-hub/starter to create a new repository based on the template.
You can also run this command to create a new project locally:
npx nuxthub init my-app
Then, inside your project directory (my-app
in the example above), run your development server:
npm run dev
Your project will be available on http://localhost:3000
Add to a Nuxt project
- Install the NuxtHub module to your project:
npx nuxi@latest module add hub
This command will install @nuxthub/core
as dependency and add it to your modules
section of your nuxt.config
.
- Install wrangler development dependency to your project:
pnpm add -D wrangler
That's it! You can now use NuxtHub features in your Nuxt project.
.data/hub
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:
export default defineNuxtConfig({
modules: ['@nuxthub/core'],
hub: {
// NuxtHub options
}
})
Default to false
- Enables analytics for your project (coming soon).
Default to false
- Enables blob storage to store static assets, such as images, videos and more.
Default to false
- Enables cache storage to cache your server route responses or functions using Nitro's cachedEventHandler
and cachedFunction
Default to false
- Enables SQL database to store your application's data.
Default to false
- Enables Key-Value to store JSON data accessible globally.
Default to false
- Allows working with remote storage (database, kv, blob) from your deployed project.
Read more about remote storage for usage.
Default to '.data/hub'
- The directory used for storage (D1, KV, R2, etc.) in development mode.
Nightly Builds
You can also use the latest features and bug fixes (commited on the main
branch) by installing the nightly tag:
{
"Dependencies": {
- "@nuxthub/core": "^0.5.0"
+ "@nuxthub/core": "npm:@nuxthub/core@nightly"
}
}
Then run npm install
, pnpm install
, yarn install
or bun install
to update the dependency.