{"id":21406692,"url":"https://github.com/ringcentral/ringcentral-c2d","last_synced_at":"2025-07-14T00:32:44.312Z","repository":{"id":34435825,"uuid":"167465284","full_name":"ringcentral/ringcentral-c2d","owner":"ringcentral","description":"RingCentral Click To Dial library","archived":false,"fork":false,"pushed_at":"2024-04-24T05:17:36.000Z","size":341,"stargazers_count":5,"open_issues_count":0,"forks_count":5,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-11T16:46:12.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ringcentral.github.io/ringcentral-c2d/","language":"TypeScript","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/ringcentral.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-25T01:33:27.000Z","updated_at":"2024-06-12T02:34:36.000Z","dependencies_parsed_at":"2023-01-15T07:03:01.027Z","dependency_job_id":"eb980141-d101-47ac-97d8-20bb9387788e","html_url":"https://github.com/ringcentral/ringcentral-c2d","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ringcentral/ringcentral-c2d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringcentral%2Fringcentral-c2d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringcentral%2Fringcentral-c2d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringcentral%2Fringcentral-c2d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringcentral%2Fringcentral-c2d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ringcentral","download_url":"https://codeload.github.com/ringcentral/ringcentral-c2d/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringcentral%2Fringcentral-c2d/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264974538,"owners_count":23691746,"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-22T16:41:56.505Z","updated_at":"2025-07-14T00:32:41.274Z","avatar_url":"https://github.com/ringcentral.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RingCentral Click To Dial library\n\n[![NPM Version](https://img.shields.io/npm/v/ringcentral-c2d.svg?style=flat-square)](https://www.npmjs.com/package/ringcentral-c2d)\n\nThis library can help you to get phone numbers in web page and show a RingCentral Click-to-Call and Click-to-Text shortcut when hover on phone number text.\n\n![clicktodial](https://user-images.githubusercontent.com/7036536/51652788-d2627200-1fcb-11e9-8ba3-9e50baeaf8a6.png)\n\n[See Demo](https://ringcentral.github.io/ringcentral-c2d/)\n\n## Install\n\nvia npm\n\n```\nnpm install ringcentral-c2d\n```\n\nvia yarn\n\n```\nyarn add ringcentral-c2d\n```\n\n## Overview\n\nThis library mainly contains 3 parts\n\n1. Matchers - For matching phone numbers in the provided page content\n2. Observers - For watching any DOM changes of the page\n3. Widgets - For injecting UI widgets for user to interact with\n\n## Get Start\n\n### With webpack:\n\n[webpack.config.js](./webpack.config.js)\n\n```javascript\nimport { RingCentralC2D, WidgetEvents } from 'ringcentral-c2d';\n\nconst clickToDial = new RingCentralC2D();\n\nclickToDial.widget.on(WidgetEvents.call, (phoneNumber) =\u003e {\n    console.log('Click to Call:', phoneNumber);\n});\n\nclickToDial.widget.on(WidgetEvents.text, (phoneNumber) =\u003e {\n    console.log('Click to Text:', phoneNumber);\n});\n\n// Stop\nclickToDial.dispose();\n```\n\n### CDN\n\n```html\n\u003cscript src=\"https://unpkg.com/ringcentral-c2d@2.0.2/build/index.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    var clickToDial = new RingCentralC2D();\n\n    clickToDial.widget.on('call', function (phoneNumber) {\n        console.log('Click to Call:', phoneNumber);\n    });\n\n    clickToDial.widget.on('text', function (phoneNumber) {\n        console.log('Click to Text:', phoneNumber);\n    });\n\n    // Stop\n    clickToDial.dispose();\n\u003c/script\u003e\n```\n\n### Advanced\n\nCustom your own widget by referencing this sample code\n\n[SampleWidget.ts](./src/widgets/SampleWidget/SampleWidget.ts)\n\n```javascript\n// Implement it by referencing sample code\nclass MyWidget {}\n\nconst myWidget = new MyWidget({\n    // Any arguments your widget needs\n});\n\n// Bind any events as you need\nmyWidget.on('your-event-name', () =\u003e {\n    // Your event handler\n});\n\nconst clickToDial = new RingCentralC2D({\n    widget: myWidget,\n});\n\n// Stop\nclickToDial.dispose();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fringcentral%2Fringcentral-c2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fringcentral%2Fringcentral-c2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fringcentral%2Fringcentral-c2d/lists"}