{"id":18888037,"url":"https://github.com/codex-team/reactions","last_synced_at":"2025-04-14T23:09:16.446Z","repository":{"id":38272707,"uuid":"155253751","full_name":"codex-team/reactions","owner":"codex-team","description":"Light-weight reactions module","archived":false,"fork":false,"pushed_at":"2022-12-08T17:08:47.000Z","size":770,"stargazers_count":5,"open_issues_count":12,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T23:09:07.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/codex-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2018-10-29T17:34:08.000Z","updated_at":"2021-11-25T07:58:18.000Z","dependencies_parsed_at":"2023-01-25T12:01:09.463Z","dependency_job_id":null,"html_url":"https://github.com/codex-team/reactions","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/codex-team%2Freactions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Freactions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Freactions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Freactions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codex-team","download_url":"https://codeload.github.com/codex-team/reactions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975315,"owners_count":21192210,"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":[],"created_at":"2024-11-08T07:41:36.928Z","updated_at":"2025-04-14T23:09:16.418Z","avatar_url":"https://github.com/codex-team.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reactions\n\nLight-weight module for gathering users' feedback on a webpage content\nAllows to build in element, containing buttons - emojis for expressing attitude to a content\n\n## Getting started\n\n### Installation \n\n#### npm or Yarn\n\n```bash\nnpm install @codexteam/reactions\n```\n\nor\n\n```bash\nyarn add @codexteam/reactions\n```\n\n#### Download from CDN\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@codexteam/reactions\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n### Simplified initialization\n\n1. Connect reactions.js script to your page\n2. Create an instance of Reactions using \n\n```javascript\nnew Reactions({parent: '', title: '', reactions: []});\n```\n\nwhere\n\n| name      | type                      | description                                                               |\n|-----------|---------------------------|---------------------------------------------------------------------------|\n| parent    | `string` or `HTMLElement` | element in which module should be inserted - selector or element instance |\n| title     | `string`                  | module title                                                              |\n| reactions | `string[]`                | array of emojis to be inserted in module options                          |\n\n\u003e Example\n\n```javascript\nnew Reactions({parent: 'body', title: 'What do you think?', reactions: ['👍', '👌', '👎']});\n```\n\n### Initialize using reactions tag\n\n1. Add `\u003creactions\u003e` to your page\n2. Provide `\u003creactions\u003e` with data-id and data-title to set module id and title\n3. Fill `\u003creactions\u003e` with `\u003creaction\u003e` each containing emoji to be inserted in module options  \n4. Connect reactions.js script to your page\n5. Run Reactions.init() \n\n\u003e example:\n\n```html \n\u003creactions data-id='' data-title='What do you think?'\u003e\n    \u003creaction\u003e😁\u003c/reaction\u003e\n    \u003creaction\u003e👍\u003c/reaction\u003e\n    \u003creaction\u003e😞\u003c/reaction\u003e\n  \u003c/reactions\u003e\n```\n\n### Advanced settings\n\n#### Identify user\n\nModule uses userId property to identify user - by default userId is random number, but it can be specified through setUserId method\n\n| name   | type     | description     |\n|--------|----------|-----------------|\n| userId | `number` | user identifier |\n\n\u003e example:\n\n```javascript\n  Reactions.setUserId(1);\n```\n#### Identify module\n\nBy default module takes page URL as module identifier, but it also can be specified manually by passing id to reactions constructor\n\nuse it for:\n* lists (different modules on one page)\n* binding module to a specific content item, regardless of URL\n\nin this case instance should be created this way\n\n```javascript\nnew Reactions({parent: '', title: '', reactions: [], id: ''});\n```\n\nwhere\n\n| name  | type                 | description       |\n|-------|----------------------|-------------------|\n| id    | `string` or `number` | module identifier |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Freactions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodex-team%2Freactions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Freactions/lists"}