Additional features

Add additional Cloudflare resource bindings to deployments

Cloudflare offer additional resources that aren't directly supported in NuxtHub yet. You can add bindings to associate these resources to your NuxtHub project. Custom bindings can be configured within hub.bindings in your nuxt.config.ts.

Additional bindings are not provisioned automatically like they are with NuxtHub features such as hub.database. You will need to create the resources manually from the Cloudflare dashboard or wrangler.

You can add additional bindings to:

View all available binding types on the Cloudflare documentation.

Configuration

Properties on hub.bindings

compatibilityDate
string

Set a custom compatibility date.
Learn more on Cloudflare's documentation.

compatibilityFlags
string

Set additional compatibility flags, separated with a space.
Learn more on Cloudflare's documentation.

The nodejs_compat flag is always enabled.

observability

Observability configurations. View all options on the observability docs.

hyperdrive
object

Hyperdrive configuration. Learn more about Hyperdrive on the PostgreSQL docs.

<BINDING NAME>
string

Binding name and Hyperdrive ID.

<additional binding type>
object

Refer to Cloudflare's API documentation to see a list of binding type names under Body parametersmetadatabindings.

<BINDING NAME>
object

Binding options (excluding properties name and type)

Additional bindings are only available within Worker project types.

Example

nuxt.config.ts
export default defineNuxtConfig({
  hub: {
    bindings: {
      // <binding type>: {
      //   <BINDING NAME>: {
      //     // binding options
      //   }
      // }

      // additional cloudflare bindings
      analytics_engine: {
        ANALYTICS_TESTING: {
          dataset: 'testing'
        }
      },
      mtls_certificate: {
        CERT: {
          certificate_id: '<CERTIFICATE_ID>'
        }
      }
    }
  },

Disallowed bindings

Some bindings types cannot be added for certain features already handled by NuxtHub that do not have additional options, or already support multiple bindings. Refer to the table below.