{"id":15063144,"url":"https://github.com/developmint/vue-if-bot","last_synced_at":"2025-04-10T10:34:05.532Z","repository":{"id":32458238,"uuid":"134455250","full_name":"Developmint/vue-if-bot","owner":"Developmint","description":"Hide stuff from bots (especially cookie consents)","archived":false,"fork":false,"pushed_at":"2022-05-30T07:14:25.000Z","size":15,"stargazers_count":66,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-25T16:45:08.310Z","etag":null,"topics":["bot","component","functional","hide","javascript","nuxtjs","plugin","ssr","user-agent","vue","vuejs"],"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/Developmint.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-22T18:01:18.000Z","updated_at":"2023-12-31T22:39:35.000Z","dependencies_parsed_at":"2022-08-30T07:30:55.558Z","dependency_job_id":null,"html_url":"https://github.com/Developmint/vue-if-bot","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developmint%2Fvue-if-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developmint%2Fvue-if-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developmint%2Fvue-if-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developmint%2Fvue-if-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Developmint","download_url":"https://codeload.github.com/Developmint/vue-if-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199245,"owners_count":21063641,"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":["bot","component","functional","hide","javascript","nuxtjs","plugin","ssr","user-agent","vue","vuejs"],"created_at":"2024-09-24T23:52:14.018Z","updated_at":"2025-04-10T10:34:05.501Z","avatar_url":"https://github.com/Developmint.png","language":"JavaScript","readme":"# VueIfBot - Hide stuff from bots (especially cookie consents) :no_entry_sign::eyes:\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://travis-ci.com/Developmint/vue-if-bot\"\u003e\u003cimg src=\"https://travis-ci.com/Developmint/vue-if-bot.svg?branch=master\" alt=\"Build Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/Developmint/vue-if-bot\"\u003e\u003cimg src=\"https://codecov.io/gh/Developmint/vue-if-bot/branch/master/graph/badge.svg\" alt=\"Code coverage\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/vue-if-bot\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/vue-if-bot.svg\" alt=\"Downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/vue-if-bot\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/vue-if-bot.svg\" alt=\"Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/vue-if-bot\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/vue-if-bot.svg\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://conventionalcommits.org\"\u003e\u003cimg src=\"https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg\" alt=\"We use Conventional Commits\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://thanks.lichter.io/\"\u003e\u003cimg src=\"https://img.shields.io/badge/thanks-%E2%99%A5-ff69b4.svg\" alt=\"Thanks badge\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e Lightweight component to hide/show content to clients based on the user agent\n\n## :interrobang: Why this component exists\n\nAs you know, the GDPR is coming (or more likely: is already applicable when you read this).\nWith it, a lot of information banners, consents concerning cookies, privacy policies and so on.\n\nThe average user will see those banners once (a year, that's the law), but search engine crawlers\nwill always see it (as they don't have any cookies and won't click on it). On **every page**.\nDepending on the screen size they take, this could be annoying and even influence your SEO (negatively).\n\nSo **stop it now!** With **VueIfBot**.\n\nHaving any other cases you need this component? Feel free to share!\n\n## :fire:  Features\n\n- **Tiny functional component**\n- SSR-safe (works with Nuxt.js)\n- Well tested and **documented**\n- Compatible with Node 8.0+\n- Vue as the only dependency\n- Highly customizable\n\n## :mag_right: Getting started\n\n\n### :package: Through NPM\n\n```\n$ npm install vue-if-bot\n```\n\n#### Synchronous import\n\n```js\nimport VueIfBot from 'vue-if-bot'\n\nexport default {\n  components: {\n    VueIfBot\n  }\n}\n\n```\n\n#### Async import\n\n```js\nexport default {\n  components: {\n    VueIfBot: () =\u003e import('vue-if-bot')\n  }\n}\n\n```\n\n### :link: Using a CDN\n\n[UNPKG](https://unpkg.com/vue-if-bot/dist/) | [jsDelivr](https://cdn.jsdelivr.net/npm/vue-if-bot/dist/) (available as window.ifBot)\n\n```js\nVue.component('if-bot', window.ifBot)\n\n// Continue as you wish\n\n```\n\n## :hammer_and_wrench: Usage\n\n### Handling\n\nBy default, all children of the component are **not** displayed to bots.\nVueIfBot detects bots by testing their user agent against the regex `/bot|googlebot|crawler|spider|robot|crawling/i`\n\n### Prop overview\n\n\n| Prop   |   Type  | Comment |\n| ---    |   ---   | ---   |\n| invert | Boolean | Inverts the behavior (shows content **only to bots**)|\n| regex  | RegExp  | Change the user agent regex to your own (eg `/test/i`)|\n\n\n### Example usage\n\n```js\n \u003cvue-if-bot\u003e\n   \u003ch1\u003eThis will not be visible for bots\u003c/h1\u003e\n \u003c/vue-if-bot\u003e\n\n \u003cvue-if-bot\n    :invert=\"true\"\u003e\n    \u003ch1\u003eThis will be visible for bots\u003c/h1\u003e\n  \u003c/vue-if-bot\u003e\n\n  \u003cvue-if-bot\n     :regex=\"/some-custom-browser/\"\u003e\n     \u003ch1\u003eThis will be visible for users whose user agent contains some-custom-browser\u003c/h1\u003e\n   \u003c/vue-if-bot\u003e\n```\n## :gear: Contributing\n\nPlease see our [CONTRIBUTING.md](./CONTRIBUTING.md)\n\n\n## :bookmark_tabs: License\n\n[MIT License](./LICENSE.md) - Copyright (c) Developmint - Alexander Lichter\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmint%2Fvue-if-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopmint%2Fvue-if-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmint%2Fvue-if-bot/lists"}