{"id":19795573,"url":"https://github.com/wearewondrous/nuxt-storyblok-queries","last_synced_at":"2025-07-06T21:11:20.894Z","repository":{"id":56164411,"uuid":"190548688","full_name":"wearewondrous/nuxt-storyblok-queries","owner":"wearewondrous","description":"Nuxt.js module to simplify queries to the Storyblok API","archived":false,"fork":false,"pushed_at":"2025-03-08T03:30:34.000Z","size":842,"stargazers_count":18,"open_issues_count":4,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-18T13:37:06.736Z","etag":null,"topics":["api","helpers","module","nuxt","nuxt-module","queries","storyblok"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wearewondrous.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-06-06T08:53:47.000Z","updated_at":"2023-05-03T09:10:56.000Z","dependencies_parsed_at":"2025-05-01T03:30:39.421Z","dependency_job_id":"ba15799b-3ec7-4d20-b4f8-a681a90e0932","html_url":"https://github.com/wearewondrous/nuxt-storyblok-queries","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/wearewondrous/nuxt-storyblok-queries","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearewondrous%2Fnuxt-storyblok-queries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearewondrous%2Fnuxt-storyblok-queries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearewondrous%2Fnuxt-storyblok-queries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearewondrous%2Fnuxt-storyblok-queries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wearewondrous","download_url":"https://codeload.github.com/wearewondrous/nuxt-storyblok-queries/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearewondrous%2Fnuxt-storyblok-queries/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261001802,"owners_count":23095656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","helpers","module","nuxt","nuxt-module","queries","storyblok"],"created_at":"2024-11-12T07:16:45.720Z","updated_at":"2025-07-06T21:11:20.852Z","avatar_url":"https://github.com/wearewondrous.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Nuxt Storyblok Queries\n\n[![NPM](https://img.shields.io/npm/v/@wearewondrous/nuxt-storyblok-queries.svg)](https://www.npmjs.com/package/@wearewondrous/nuxt-storyblok-queries)\n[![CircleCI](https://circleci.com/gh/wearewondrous/nuxt-storyblok-queries.svg?style=shield\u0026circle-token=53485e7e4fa60a611464761450c6230f5bafe9ff)](https://circleci.com/gh/wearewondrous/nuxt-storyblok-queries)\n[![Standard JS][standard-js-src]][standard-js-href]\n\n\u003e Nuxt.js module to simplify queries to the Storyblok API\n\n[📖 **Release Notes**](./CHANGELOG.md)\n\n## Setup\n\n1. Add the `@wearewondrous/nuxt-storyblok-queries` dependency with `yarn` or `npm` to your project\n2. Add `@wearewondrous/nuxt-storyblok-queries` to the `modules` section of `nuxt.config.js`\n3. Configure it:\n\n```js\n{\n  modules: [\n    ['@wearewondrous/nuxt-storyblok-queries', {\n      // Module options here\n    }]\n  ]\n}\n```\n\n### Using top level options\n\n```js\n{\n  modules: [\n    '@wearewondrous/nuxt-storyblok-queries'\n  ],\n  storyblokQueries: [\n    // Module options here\n  ]\n}\n```\n\n## Options\n\n### `accessToken`\n\n- Default: `this.options.storyblok || ''`\n\nAccess Token for the StoryBlok API. Not needed if you already have installed the [Storyblok Nuxt.js module](https://github.com/storyblok/storyblok-nuxt)\n\n### `cacheProvider`\n\n- Default: `'memory'`\n\nCache Provider for the StoryBlok API. Not needed if you already have installed the [Storyblok Nuxt.js module](https://github.com/storyblok/storyblok-nuxt) \n\n### `version`\n\n- Default: `'auto'`\n\nVersion of the Storyblok Content. Use 'draft' together with the preview Access Token.\n\n### `defaultLanguage`\n\n- Default: `''`\n\nOptional. If your Storyblok Site has multiple languages, set `defaultLanguage` to the key of your Storyblok default language.\n\n## Usage\n\nThis modules adds a simple API to query your Storyblok Content.\n\n* [$storyblok.getStory()](#storyblokgetstorypath-options)\n* [$storyblok.getCurrentStory()](#storyblokgetcurrentstoryoptions)\n* [$storyblok.getStoryCollection()](#storyblokgetstorycollectionpath-options)\n* [$storyblok.getSettings()](#storyblokgetsettingslang-options)\n* [$storyblok.getCurrentSettings()](#storyblokgetcurrentsettingsoptions)\n* [$storyblok.getDatasource()](#storyblokgetdatasourcepath)\n\n### `$storyblok.getStory(path, options)`\n\nFetches the story by the given path. The Language gets automatically detected or can be specified in the options parameter.\n\n```js\nexport default {\n  async asyncData({ $storyblok }) {\n    const story = await $storyblok.getStory(\"home\")\n\n    return story\n  }\n}\n```\n\n#### with Options\n```js\nexport default {\n  async asyncData({ $storyblok }) {\n    const story = await $storyblok.getStory(\"home\", {\n      lang: \"de\"\n    })\n\n    return story\n  }\n}\n```\n\n### `$storyblok.getCurrentStory(options)`\n\nFetches the story by the current Route. The Language gets automatically detected but can also be specified in the options parameter.\n\n```js\nexport default {\n  async asyncData({ $storyblok, route }) {\n    console.log(route.path) // -\u003e /story\n    const story = await $storyblok.getCurrentStory()\n\n    return story\n  }\n}\n```\n\n#### with Options\n```js\nexport default {\n  async asyncData({ $storyblok, route }) {\n    console.log(route.path) // -\u003e /story\n    const story = await $storyblok.getCurrentStory({\n      lang: \"de\"\n    })\n\n    return story\n  }\n}\n```\n\n### `$storyblok.getStoryCollection(path, options)`\n\nFetches all Stories matching the given path. The Language gets automatically detected but can also be specified in the options parameter.\n\n```js\nexport default {\n  async asyncData({ $storyblok, route }) {\n    const collection = await $storyblok.getStoryCollection(\"blog\")\n\n    return collection\n  }\n}\n```\n\n#### with Options\n```js\nexport default {\n  async asyncData({ $storyblok, route }) {\n    const collection = await $storyblok.getStoryCollection(\"blog\", {\n      lang: \"de\",\n      startpage: true // if true, startpage of collection gets fetched as well\n    })\n\n    return collection\n  }\n}\n```\n\n\n### `$storyblok.getSettings(lang, options)`\n\nFetches the settings page of the given language. The path for the settings route can be specified in the options parameter or falls back to `/settings`.\n\n```js\nexport default {\n  async asyncData({ $storyblok, route }) {\n    const settings = await $storyblok.getSettings(\"de\")\n\n    return {\n      //...\n      settings\n    }\n  }\n}\n```\n\n#### with Options\n```js\nexport default {\n  async asyncData({ $storyblok, route }) {\n    const settings = await $storyblok.getSettings(\"de\", {\n      path: \"global\"\n    })\n\n    return {\n      //...\n      settings\n    }\n  }\n}\n```\n\n\n### `$storyblok.getCurrentSettings(options)`\n\nFetches the settings page of the current language detected by the current route. The path for the settings route can be specified in the options parameter or falls back to `/settings`.\n\n```js\nexport default {\n  async asyncData({ $storyblok, route }) {\n    const settings = await $storyblok.getCurrentSettings()\n\n    return {\n      //...\n      settings\n    }\n  }\n}\n```\n\n#### with Options\n```js\nexport default {\n  async asyncData({ $storyblok, route }) {\n    const settings = await $storyblok.getCurrentSettings({\n      path: \"global\"\n    })\n\n    return {\n      //...\n      settings\n    }\n  }\n}\n```\n\n\n### `$storyblok.getDatasource(path)`\n\nFetches the datasource by the given path.\n\n```js\nexport default {\n  async asyncData({ $storyblok, route }) {\n    const datasource = await $storyblok.getDatasource(\"users\")\n\n    return {\n      //...\n      datasource\n    }\n  }\n}\n```\n\n\n### `$storyblok.renderRichText(richTextContent)`\n\nRenders the Storyblok richtext field content and returns an HTML string.\n\n```html\n\u003cdiv v-html=\"$storyblok.renderRichTest(story.content.rich_text)\" /\u003e\n```\n\n\n## Development\n\n1. Clone this repository\n2. Install dependencies using `yarn install` or `npm install`\n3. Start development server using `npm run dev`\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) [WONDROUS LTD](https://www.wearewondrous.com/)\n\n\u003c!-- Badges --\u003e\n[standard-js-src]: https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square\n[standard-js-href]: https://standardjs.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearewondrous%2Fnuxt-storyblok-queries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwearewondrous%2Fnuxt-storyblok-queries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearewondrous%2Fnuxt-storyblok-queries/lists"}