{"id":19267765,"url":"https://github.com/jhta/vue-trustpilot","last_synced_at":"2025-04-21T19:33:09.888Z","repository":{"id":45493886,"uuid":"204645812","full_name":"jhta/vue-trustpilot","owner":"jhta","description":"Plugin to create Trustpilot widgets in an easy way.","archived":false,"fork":false,"pushed_at":"2021-12-10T13:42:33.000Z","size":13,"stargazers_count":6,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T16:14:49.575Z","etag":null,"topics":["plugin","trustpilot","vue","widget"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-27T07:29:03.000Z","updated_at":"2024-03-04T10:18:38.000Z","dependencies_parsed_at":"2022-07-19T01:47:26.930Z","dependency_job_id":null,"html_url":"https://github.com/jhta/vue-trustpilot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhta%2Fvue-trustpilot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhta%2Fvue-trustpilot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhta%2Fvue-trustpilot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhta%2Fvue-trustpilot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhta","download_url":"https://codeload.github.com/jhta/vue-trustpilot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250120183,"owners_count":21378150,"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":["plugin","trustpilot","vue","widget"],"created_at":"2024-11-09T20:14:00.791Z","updated_at":"2025-04-21T19:33:09.627Z","avatar_url":"https://github.com/jhta.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-trustpilot\n\nPlugin to create Trustpilot widgets in an easy way.\n\n## Install\n\n```bash\nnpm install vue-trustpilot --save\n```\n\n## How to use it:\n\nAdd the static trustpilot script\n\n```html\n\u003cscript\n  src=\"https://widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js\"\n  async=\"\"\n\u003e\u003c/script\u003e\n```\n\n```js\nimport TrustpilotPlugin from \"vue-trustpilot\";\n\nconst carouselWidget = {\n  templateId: \"XXXX\",\n  businessunitId: \"XXXXX\",\n  reviewUrl: \"trustpilot.review.com/mywebsite.com\",\n  locale: \"en-us\"\n  // ...more Trstupilot options in camel case\n};\n\nconst reviewsListWidget = {\n  templateId: \"XXXX\",\n  businessunitId: \"XXXXX\",\n  reviewUrl: \"trustpilot.review.com/mywebsite.com\",\n  locale: \"en-us\"\n  // ...more Trstupilot options in camel case\n};\n\nconst options = {\n  widgets: {\n    carousel: carouselWidget,\n    list: reviewsListWidget\n  }\n};\n\nVue.use(TrustpilotPlugin, options);\n```\n\nThe Plugin going to register the component `vue-trustpilot` globally.\n\nIn your Vue component:\n\n```vue\n\u003ctemplate\u003e\n  \u003cvue-trustpilot identifier=\"carousel\" /\u003e\n\u003c/template\u003e\n```\n\nAlso, you can add more custom trustpilot arguments directly:\n\n```vue\n\u003ctemplate\u003e\n  \u003cvue-trustpilot\n    identifier=\"carousel\"\n    data-theme=\"light\"\n    data-schema-type=\"Organization\"\n    data-stars=\"1,2,3,4,5\"\n  /\u003e\n\u003c/template\u003e\n```\n\nThe result:\n\n![](https://cl.ly/3837b22ea642/download/Image%2525202019-08-27%252520at%2525209.43.35%252520AM.png)\n\nAdditionally you can access to your widgets data using the method `$trustpilot` in Vue global scope\n\n```vue\n\u003cscript\u003e\n export default {\n   methods: {\n     printWidgetData() {\n      console.log(this.$trustpilot('carousel'))\n     }\n   }\n  }\n\n```\n\n## Nuxt\n\n```js\n// trustpilot.js\nconst config = {\n  widgets: {\n    carousel: carouselWidget,\n    list: reviewsListWidget\n  }\n};\n\nmodule.exports = config;\n```\n\n```js\n// nuxt.config.js\n\nconst trustpilot = require(\"./trustpilot\");\n\nconst config = {\n  modules: [[\"vue-trustpilot/nuxt\", trustpilot]]\n};\n```\n\nNOTE: For Nuxt module is not needed to add the truspilot script\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhta%2Fvue-trustpilot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhta%2Fvue-trustpilot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhta%2Fvue-trustpilot/lists"}