All skills
onmax avatar

/nuxthub

@9b5f595 official
by Maxonmax/nuxt-skills715 stars
38

Use when building NuxtHub v0.10.6 applications - provides database (Drizzle ORM with sqlite/postgresql/mysql), KV storage, blob storage, and cache APIs. Covers configuration, schema definition, migrations, multi-cloud deployment (Cloudflare, Vercel), and the new hub:db, hub:kv, hub:blob virtual module imports.

Use this Skill: https://skilld.dev/gh/onmax/nuxt-skills/nuxthub

This session only. Nothing lands on disk.

referencesproviders.md

≈1.5k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Multi-Cloud Deployment Patterns

NuxtHub supports Cloudflare, Vercel, Netlify, and other cloud providers with auto-detection based on environment.

Cloudflare

Primary deployment target - full feature support (D1, KV, R2, Cache).

Auto-Configuration

NuxtHub generates wrangler.json from hub config:

// nuxt.config.ts
export default defineNuxtConfig({
  hub: {
    db: {
      dialect: 'sqlite',
      driver: 'd1',
      connection: { databaseId: '<database-id>' }
    },
    kv: {
      driver: 'cloudflare-kv-binding',
      namespaceId: '<kv-namespace-id>'
    },
    cache: {
      driver: 'cloudflare-kv-binding',
      namespaceId: '<cache-namespace-id>'
    },
    blob: {
      driver: 'cloudflare-r2',
      bucketName: '<bucket-name>'
    }
  }
})

Observability (Recommended)

Enable logging for production:

// wrangler.jsonc
{
  "observability": {
    "logs": {
      "enabled": true,
      "head_sampling_rate": 1,
      "invocation_logs": true,
      "persist": true
    }
  }
}

Create Resources

npx wrangler d1 create my-db
npx wrangler kv namespace create KV
npx wrangler kv namespace create CACHE
npx wrangler r2 bucket create my-bucket

Environments

# Production
npx nuxi build

# Preview/Staging
CLOUDFLARE_ENV=preview npx nuxi build

Configure in wrangler.jsonc:

{
  "d1_databases": [{ "binding": "DB", "database_id": "prod-id" }],
  "env": {
    "preview": {
      "d1_databases": [{ "binding": "DB", "database_id": "preview-id" }]
    }
  }
}

Vercel

Deploy NuxtHub apps on Vercel with marketplace integrations.

Database

Option 1: Vercel Postgres

# Via Vercel dashboard: Storage > Create Database > Postgres
# Get DATABASE_URL from environment variables
// nuxt.config.ts
export default defineNuxtConfig({
  hub: {
    db: {
      dialect: 'postgresql',
      driver: 'postgres-js'
      // DATABASE_URL env var auto-detected
    }
  }
})

Option 2: Turso (SQLite)

# Install via Vercel Marketplace
# Get TURSO_DATABASE_URL and TURSO_AUTH_TOKEN
hub: {
  db: {
    dialect: 'sqlite',
    driver: 'libsql'
    // TURSO_* env vars auto-detected
  }
}

KV Storage

Vercel KV (Upstash Redis)

# Via Vercel dashboard: Storage > Create > KV
# Get KV_REST_API_URL and KV_REST_API_TOKEN
hub: {
  kv: true
  // Auto-detects Vercel KV via env vars
}

Alternative: Upstash Redis

hub: {
  kv: {
    driver: 'redis',
    // UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN
  }
}

Blob Storage

Vercel Blob

# Via Vercel dashboard: Storage > Create > Blob
# Get BLOB_READ_WRITE_TOKEN
hub: {
  blob: true
  // Auto-detects Vercel Blob via env var
}

Cache

Uses Vercel Runtime Cache (built-in):

hub: {
  cache: true
  // Auto-uses Vercel runtime cache in production
}

Netlify

Compatible with NuxtHub via external database providers.

Database

Use external providers via env vars:

  • Turso: TURSO_DATABASE_URL, TURSO_AUTH_TOKEN
  • Neon: DATABASE_URL (PostgreSQL)
  • PlanetScale: DATABASE_URL (MySQL)
// nuxt.config.ts
export default defineNuxtConfig({
  hub: {
    db: {
      dialect: 'sqlite',
      driver: 'libsql' // or postgres-js, mysql2
    }
  }
})

KV Storage

  • Upstash Redis: UPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN
  • AWS S3 (as KV): S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_BUCKET, S3_REGION
hub: {
  kv: true // Auto-detects provider
}

Blob Storage

AWS S3

# Set env vars in Netlify dashboard
S3_ACCESS_KEY_ID=<key>
S3_SECRET_ACCESS_KEY=<secret>
S3_BUCKET=<bucket-name>
S3_REGION=<region>
hub: {
  blob: true // Auto-detects S3 config
}

Other Providers (Generic)

Deno Deploy

Deno KV (auto-detected):

hub: {
  kv: true // Uses Deno.openKv()
}

AWS / Self-Hosted

Database:

  • PostgreSQL: DATABASE_URL
  • MySQL: DATABASE_URL or MYSQL_URL
  • SQLite: Local filesystem

Blob (S3):

hub: {
  blob: {
    driver: 's3',
    // S3_* env vars
  }
}

KV (S3 or Redis):

hub: {
  kv: {
    driver: 'redis',
    // REDIS_URL or S3 config
  }
}

Provider Detection

NuxtHub auto-detects hosting environment via:

  1. NITRO_PRESET env var
  2. Platform-specific env vars (Vercel, Netlify, Cloudflare)
  3. Explicit driver configuration in hub config

Manual override:

nitro: {
  preset: 'cloudflare-pages' // or 'vercel', 'netlify', etc.
}

Environment Variables Summary

Provider Database KV Blob
Cloudflare Config (database_id) Config (namespace_id) Config (bucket_name)
Vercel DATABASE_URL KV_REST_API_URL, KV_REST_API_TOKEN BLOB_READ_WRITE_TOKEN
Netlify DATABASE_URL, TURSO_* UPSTASH_*, S3_* S3_*
Generic DATABASE_URL, MYSQL_URL REDIS_URL, UPSTASH_*, S3_* S3_*
Deno DATABASE_URL or Turso Auto (Deno.openKv) S3_*

Best Practices

  1. Cloudflare: Use hub config in nuxt.config, add observability in wrangler.jsonc
  2. Vercel: Leverage Vercel Marketplace for managed services
  3. Other providers: Use env vars for credentials, avoid hardcoding in config
  4. Development: Use hub.remote: true to test with production bindings locally
  5. Secrets: Store in platform secret managers, not in git

Source: SKILL.md on GitHub

1 warning12d5 checks · Risk SAFE
  • Gen Agent Trust Hub12d

    The skill provides comprehensive documentation and configuration templates for NuxtHub v0.10.6, covering database integration, storage, and deployment across major cloud providers. No security risks or malicious patterns were detected; the skill follows security best practices by emphasizing the use of environment variables and platform-specific secret managers for handling credentials.

  • Socket12d

    No alerts

  • Snyk12d

    Risk: LOW · No issues

  • Runlayer7mo

    2/3 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 9b5f595. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 8 months ago
  • Nuxt
  • Database
  • drizzle
  • orm
  • sqlite
  • postgresql
  • mysql
  • kv-storage
  • blob-storage
  • cloudflare

README badge

README badge for onmax/nuxt-skills/nuxthub

Configures and deploys Nuxt applications with Drizzle ORM databases (SQLite, PostgreSQL, MySQL), KV storage, blob upload, and response caching. Supports multi-cloud deployment to Cloudflare Workers, Vercel, Netlify, and Deno with auto-generated bindings and migration management.

Generated from the current SKILL.md.

Does this skill cover both local development and production deployment?
Yes. It supports local SQLite/PGlite development with auto-migration on dev/build, and production deployment to Cloudflare (D1), Vercel, Netlify, Deno Deploy, and external providers like Postgres, MySQL, Turso, and S3.
What database dialects are supported?
SQLite, PostgreSQL, and MySQL. Each has different local emulation and production provider options (e.g. SQLite uses local .data/db/sqlite.db or D1/Turso in production).
Is Drizzle ORM required?
Yes. The skill uses Drizzle ORM for type-safe SQL queries across all database dialects. Schemas are defined in server/db/schema.ts using Drizzle column and table types.
Can I use this skill for content management?
For content with database backing, use the nuxt-content skill instead. This skill covers database, KV, blob, and cache APIs directly, not content-specific workflows.
Does this handle file uploads and storage?
Yes. The blob API supports file upload, download, listing, and deletion. It includes multipart upload for large files (>10MB) and integrates with Cloudflare R2, Vercel Blob, and S3.

Generated from the current SKILL.md. These answers refresh after source changes.