
Skill
rstore-nuxt-monospace
integrate Monospace into Nuxt applications
Description
Use when wiring Monospace into a Nuxt app with @rstore/nuxt-monospace, including rstoreMonospace config, remote or local OpenAPI generation, generated #build templates, runtime plugin setup, auto-imported useMonospace, runtimeApiKey handling, primaryKeys, and generated rstore collections. Pair with rstore-monospace for shared REST/OpenAPI behavior, rstore-nuxt for Nuxt store integration, and rstore-vue for query/form usage.
SKILL.md
Rstore Nuxt Monospace
Use @rstore/nuxt-monospace to generate Monospace-backed rstore collections and register the runtime REST plugin in Nuxt.
Setup
Register the Nuxt module:
export default defineNuxtConfig({
modules: [
'@rstore/nuxt-monospace',
],
rstoreMonospace: {
url: 'https://your-monospace-instance.com',
project: 'your-project',
schemaApiKey: process.env.MONOSPACE_API_KEY,
scopeId: 'rstore-monospace',
},
})
Use generated collections through useStore():
const store = useStore()
const { data } = await store.Todos.query(q => q.many({
fields: ['id', 'title'],
limit: 20,
}))
Use the auto-imported REST client when direct Monospace access is intentional:
const monospace = useMonospace()
const todos = await monospace.readMany('Todos', { limit: 10 })
Options
| Option | Purpose |
|---|---|
url | Monospace API URL |
project | Monospace project identifier |
schemaApiKey | Build-time key for remote schema loading (needs openApiSchema:read + dataModel:read) |
input | Local OpenAPI JSON path, resolved from Nuxt root |
metadataInput | Local schema metadata snapshot JSON path, resolved from Nuxt root |
runtimeApiKey | Runtime API key emitted into generated config |
scopeId | rstore plugin scope id, defaulting to rstore-monospace |
primaryKeys | Explicit primary key overrides by collection name |
Generated Nuxt Templates
$rstore-monospace-collections.jscontains runtime collection definitions.$rstore-monospace-items.d.tscontains generated item interfaces.$rstore-monospace-collections.d.tscontains typed collection declarations.$rstore-monospace-config.jscontains runtime URL, project, optional API key, and scope id.
Module Behavior
- The module depends on
@rstore/nuxt. - It adds generated collections through
addCollectionImport. - It adds the runtime plugin through
addPluginImport. - It registers runtime type references and auto-imports
useMonospace(). - Missing
urlorprojectskips collection generation with a warning.
Guardrails
- Keep
schemaApiKeyserver-side/build-time. - Configure
runtimeApiKeyonly when the value is safe to expose through generated runtime config. - Use
inputplusmetadataInputfor checked-in or separately generated schemas; generation needs both the OpenAPI document and the schema metadata. - Prefer generated rstore collections and plugin wiring over custom Nuxt API routes for generated collections.
- Use
rstore-monospacefor shared OpenAPI, REST, query, and mutation behavior. - Use
rstore-nuxtfor base Nuxt rstore module behavior andrstore-vuefor query/form/cache semantics.
More skills from the rstore repository
View all 8 skillsrstore-directus
integrate rstore with Directus
Jul 12API DevelopmentDatabaseDirectusrstore-monospace
integrate rstore with Monospace REST APIs
Jul 12OpenAPIREST APIrstore-nuxt
integrate rstore into Nuxt applications
Jul 12FrontendNuxtVuerstore-nuxt-drizzle
expose Drizzle data in Nuxt applications
Jul 12API DevelopmentDatabaseDrizzleNuxtrstore-vite-directus
integrate Directus into Vite applications
Jul 12API DevelopmentDirectusViteVuerstore-vite-monospace
integrate Monospace into Vite applications
Jul 12API DevelopmentDirectusViteVue