{"id":13506698,"url":"https://github.com/yashha/wp-nuxt","last_synced_at":"2025-03-30T05:31:19.711Z","repository":{"id":42901690,"uuid":"110484359","full_name":"yashha/wp-nuxt","owner":"yashha","description":"NOT MAINTAINED The module adds WP-API to your nuxt application.","archived":true,"fork":false,"pushed_at":"2023-03-04T03:43:23.000Z","size":3974,"stargazers_count":219,"open_issues_count":32,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-13T14:46:53.945Z","etag":null,"topics":["frontend","javascript","nuxt","rest-api","ssr","wordpress","wp-api","wp-nuxt"],"latest_commit_sha":null,"homepage":"https://wp-nuxt.netlify.com/","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/yashha.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}},"created_at":"2017-11-13T01:16:50.000Z","updated_at":"2023-12-15T01:20:11.000Z","dependencies_parsed_at":"2024-01-13T19:33:39.606Z","dependency_job_id":null,"html_url":"https://github.com/yashha/wp-nuxt","commit_stats":{"total_commits":169,"total_committers":9,"mean_commits":18.77777777777778,"dds":"0.49112426035502954","last_synced_commit":"d1d7f624fb2f19c1dd4ff3f04bbe2e992a9053c7"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashha%2Fwp-nuxt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashha%2Fwp-nuxt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashha%2Fwp-nuxt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashha%2Fwp-nuxt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yashha","download_url":"https://codeload.github.com/yashha/wp-nuxt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246281099,"owners_count":20752203,"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":["frontend","javascript","nuxt","rest-api","ssr","wordpress","wp-api","wp-nuxt"],"created_at":"2024-08-01T01:00:55.715Z","updated_at":"2025-03-30T05:31:19.340Z","avatar_url":"https://github.com/yashha.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized","JavaScript"],"sub_categories":["Uncategorized"],"readme":"# wp-nuxt\n\n[![npm (scoped with tag)](https://img.shields.io/npm/v/wp-nuxt.svg?style=flat-square)](https://www.npmjs.com/package/wp-nuxt)\n[![npm](https://img.shields.io/npm/dt/wp-nuxt.svg?style=flat-square)](https://www.npmjs.com/package/wp-nuxt)\n[![CircleCI](https://img.shields.io/circleci/project/github/yashha/wp-nuxt.svg?style=flat-square)](https://circleci.com/gh/yashha/wp-nuxt)\n[![Codecov](https://img.shields.io/codecov/c/github/yashha/wp-nuxt.svg?style=flat-square)](https://codecov.io/gh/yashha/wp-nuxt)\n[![Dependencies](https://david-dm.org/yashha/wp-nuxt/status.svg?style=flat-square)](https://david-dm.org/yashha/wp-nuxt)\n[![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fyashha%2Fwp-nuxt.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fyashha%2Fwp-nuxt?ref=badge_shield)\n[![Netlify Status](https://api.netlify.com/api/v1/badges/4bb695b5-6b46-4c3f-a866-33aaf727570a/deploy-status)](https://app.netlify.com/sites/wp-nuxt/deploys)\n\n[📖 **Release Notes**](./CHANGELOG.md)\n\n## Features\n\nThe module adds [WP-API](https://github.com/WP-API/node-wpapi) to your nuxt application.\n\nThe size of the library is 49,8 kB minified (14 kB gzipped). [![npm bundle size](https://img.shields.io/bundlephobia/minzip/wpapi.svg)](https://bundlephobia.com/result?p=wpapi)\n\n## Setup\n\n- Add `wp-nuxt` dependency using yarn or npm to your project\n\n- Add `wp-nuxt` to `modules` section of `nuxt.config.js`\n\n```js\n{\n  modules: [\n    // Simple usage\n    'wp-nuxt',\n\n    // With options\n    ['wp-nuxt', {\n      endpoint: 'https://wp.kmr.io/wp-json',\n      extensions: true // For additional functions of wpapi-extensions\n      /* other options of WP-API */\n    }],\n ]\n}\n```\nInfo: when you pass `extensions: true` you will have additional functions of [wpapi-extensions](https://github.com/yashha/wpapi-extensions) available. For this you also have to install [WUXT Headless WordPress API Extensions](https://wordpress.org/plugins/wuxt-headless-wp-api-extensions/) on your wordpress sever.\n\n## Usage\n\nYou can use the API of [WP-API](https://github.com/WP-API/node-wpapi) using the injected 'app.$wp'. (s. example)\n\n### Example\n\n```js\n\u003cscript\u003e\nexport default {\n  async asyncData ({ app, store, params }) {\n    return { articles: await app.$wp.posts().perPage(10) }\n  }\n}\n\u003c/script\u003e\n```\n\n## Basic RSS feed integration\n\nTo use an automatically generated rss feed under `/feed.xml` you have to add following to your the `nuxt.config.js`.\nIt will automatically fetch the posts from your rest endpoint provided in the options. ([demo](https://wp-nuxt.netlify.com/feed.xml))\n\n```js\nconst wpNuxtFeed = require('wp-nuxt/lib/rss')\n\nmodule.exports = {\n  feed: [\n    wpNuxtFeed({\n      baseUrl: 'http://localhost:3000'\n    })\n  ]\n}\n```\nTo prevent injecting the default link tag into the head you can pass the option `injectDefaultHead: false`.\nAny options such as title or description can be overwritten through the function options. For more options look into the  [feed module](https://github.com/nuxt-community/feed-module) and the [definition of th function](https://github.com/yashha/wp-nuxt/blob/master/lib/rss/index.js).\n\n\n## Basic sitemap integration\nUsing the module [nuxtjs/sitemap](https://github.com/nuxt-community/sitemap-module) a opinionated sitemap is provided by default.\n\n\nSpecific options can be overwritten like the following in the `nuxt.config.js`:\n```js\nmodule.exports = {\n  wp: {\n    sitemap: {\n      hostname: process.env.HOSTNAME // default; format e.g. 'http://localhost:3000'\n    }\n  }\n}\n```\n\nIt can be completely overwritten using the `sitemap` property in the `nuxt.config.js` and deactivated using following:\n```js\nmodule.exports = {\n  wp: {\n    sitemap: false\n  }\n}\n\n```\n\nSee more options in the extension [nuxtjs/sitemap](https://github.com/nuxt-community/sitemap-module) or in the following [file](https://github.com/yashha/wp-nuxt/blob/master/lib/module/sitemap.js)\n\n## Custom Routes\nYou can register your own routes e.g. for custom extentions.\n\n```js\nmodule.exports = {\n  wp: {\n    endpoint: 'https://wp.kmr.io/wp-json',\n    customRoutes: [\n      {\n        extension: 'wp/v2',\n        route: 'custom-taxonomy',\n        name: 'customTaxonomy'\n      }\n    ]\n  }\n}\n```\nThis will call `wp.customTaxonomy = wp.registerRoute('wp/v2','custom-taxonomy'` and make it available as `app.$wp.customTaxonomy()`\n\n## Auto-Discovery\n\nFor more infos: https://github.com/WP-API/node-wpapi/tree/master#auto-discovery\n\n```js\nmodule.exports = {\n  wp: {\n    endpoint: 'https://wp.kmr.io/wp-json',\n    discover: true // To auto-discover routes by url provided in 'endpoint'\n  }\n}\n```\n\nInfo: Make sure to handle CORS correctly. s. https://github.com/WP-API/node-wpapi/tree/master#cross-origin-auto-discovery\n\n## Browser Support\n\nIE11 seems to work, but throws errors. ([Help wanted](https://github.com/yashha/wp-nuxt/issues/67))\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) [yashha](https://github.com/yashha)\n\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fyashha%2Fwp-nuxt.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fyashha%2Fwp-nuxt?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashha%2Fwp-nuxt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyashha%2Fwp-nuxt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashha%2Fwp-nuxt/lists"}