Getting Started

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 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:

Terminal
npx nuxthub init my-app

Add to a Nuxt project

  1. Install the NuxtHub package to your project:
pnpm add @nuxthub/core
  1. Install wrangler development dependency to your project:
pnpm add -D wrangler
  1. Add @nuxthub/core to your extends section in your nuxt.config:
nuxt.config.ts
export default defineNuxtConfig({
  extends: ['@nuxthub/core']
})

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

NuxtHub will create a .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:

nuxt.config.ts
export default defineNuxtConfig({
  extends: ['@nuxthub/core'],
  hub: {
    // NuxtHub options
  }
})
remote
boolean|string

Default to false - Allows working with remote storage (database, kv, blob) from your deployed project.
Read more about remote storage for usage.

You're all set! Now, let's dive into connecting to your Cloudflare account and deploying it on the Edge.

Copyright NuxtLabs © 2024