Additional features
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:
- Add additional D1 databases, R2 buckets (blob), KV namespaces & analytics datasets
- or use service bindings, rate limiting, queues, and more
Configuration
Properties on hub.bindings
Set a custom compatibility date.
Learn more on Cloudflare's documentation.
Set additional compatibility flags, separated with a space
.
Learn more on Cloudflare's documentation.
The nodejs_compat
flag is always enabled.
Observability configurations. View all options on the observability docs.
Hyperdrive configuration. Learn more about Hyperdrive on the PostgreSQL docs.
<BINDING NAME>stringBinding name and Hyperdrive ID.
Refer to Cloudflare's API documentation to see a list of binding type names under Body parameters
→ metadata
→ bindings
.
<BINDING NAME>objectBinding options (excluding properties
name
andtype
)
Example
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.
ai
→hub.ai
assets
→hub.workers
browser_rendering
→hub.browser
vectorize
→hub.vectorize