{"id":15918160,"url":"https://github.com/jfrux/ember-cli-olark","last_synced_at":"2025-09-25T16:36:13.558Z","repository":{"id":57223406,"uuid":"88987337","full_name":"jfrux/ember-cli-olark","owner":"jfrux","description":"Initializes and exposes an olark service allowing access to Olark API to your ember application.","archived":false,"fork":false,"pushed_at":"2018-01-30T20:36:14.000Z","size":88,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T02:54:58.467Z","etag":null,"topics":[],"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/jfrux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-21T13:36:46.000Z","updated_at":"2018-03-17T06:02:02.000Z","dependencies_parsed_at":"2022-08-24T15:41:59.431Z","dependency_job_id":null,"html_url":"https://github.com/jfrux/ember-cli-olark","commit_stats":null,"previous_names":["joshuairl/ember-cli-olark"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrux%2Fember-cli-olark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrux%2Fember-cli-olark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrux%2Fember-cli-olark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfrux%2Fember-cli-olark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfrux","download_url":"https://codeload.github.com/jfrux/ember-cli-olark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250531940,"owners_count":21446086,"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-10-06T18:40:39.607Z","updated_at":"2025-09-25T16:36:13.455Z","avatar_url":"https://github.com/jfrux.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Ember Observer Score](http://emberobserver.com/badges/ember-cli-olark.svg)](http://emberobserver.com/addons/ember-cli-olark)\n\n# ember-cli-olark\n\nSimple Olark Service for your Ember CLI app.\n\nThis addon lets you inject, configure and interact with the Olark API.\n\n[Olark API for Javascript reference doc](https://www.olark.com/api) for\ndetails on the usage.\n\nThe methods implemented are:\n\n* TODO / Checklist of Implemented\n\t- [x] Events (onExpand, onShow, etc.)\n\t\t- [x] box.onHide `on('hide')`\n\t\t- [x] box.onShow `on('show')`\n\t\t- [x] box.onExpand `on('expand')`\n\t\t- [x] box.onShrink `on('shrink')`\n\t\t- [x] chat.onReady `on('ready')`\n\t\t- [x] chat.onOperatorsAvailable `on('operatorsAvailable')`\n\t\t- [x] chat.onOperatorsAway `on('operatorsAway')`\n\t\t- [x] chat.onBeginConversation `on('beginConversation')`\n\t\t- [x] chat.onMessageToOperator `on('messageToOperator')`\n\t\t- [x] chat.onMessageToVisitor `on('messageToVisitor')`\n\t\t- [x] chat.onCommandFromOperator `on('commandFromOperator')`\n\t\t- [x] chat.onOfflineMessageToOperator `on('offlineMessageToOperator')`\n\t- [ ] Chat conversation\n\t\t- [ ] setOperatorGroup\n\t\t- [ ] sendMessageToVisitor\n\t\t- [ ] sendNotificationToOperator\n\t\t- [ ] sendNotificationToVisitor\n\t- [x] Chat box behavior\n\t  - [x] showBox (Shows the button)\n\t  - [x] hideBox (Hides the button)\n\t  - [x] expandBox (Shows the actual window)\n\t  - [x] shrinkBox (Hides the actual window)\n\t\t- [x] setLocale (Sets the language settings for the box)\n\t- [x] Visitor information\n\t\t- [x] getVisitorDetails [returns promise]\n\t\t- [x] updateVisitorStatus(string or [array of strings])\n\t\t- [x] updateVisitorNickname(string)\n\t\t- [x] updateVisitorFullName(fullName)\n\t\t- [x] updateVisitorEmail(emailAddress)\n\t\t- [x] updateVisitorPhoneNumber(phoneNumber)\n\t\t- [x] updateVisitorCustomField(fieldName,fieldValue)\n\t\t- [x] updateVisitorCustomFields(pojo)\n\t- [ ] Pre-chat survey\n\t\t- [ ] system.ask_for_name\n\t\t- [ ] system.ask_for_email\n\t\t- [ ] system.ask_for_phone\n\n## Installation\n\n* `ember install ember-cli-olark`\n\n## Usage and configuration\n\n### Configuration\n\nBefore using the [Olark JS API](https://www.olark.com/api) you need\nto include it in your HTML. The most convenient way to do it is by using the addon service's OlarkInit method.\nTo do so, you must configure the parameters to use to initialize the Olark API in your `config/environment.js` file in the `OLARK` key.\nThe following is a basic example of such a configuration:\n\n```js\n  OLARK = {\n    identity: 'YOUR IDENTITY KEY'\n\t\tconfigure: [ //NOT YET IMPLEMENTED\n\t\t\t{ 'system.hb_primary_color': '#744da8' }\n\t\t]\n  }\n```\n\nYou need to replace **YOUR IDENTITY KEY** with your own Olark Identity Key (which can be found in the original embed code provided by Olark)\n\n### Usage\nIf you find yourself, needing the service in all your controllers you could inject the service by default in your controller like the following:\n\n```js\nexport function initialize(application) {\n  application.inject('controller', 'olark', 'service:olark');\n}\n\nexport default {\n  name: 'olark',\n  initialize\n};\n```\n\n### Initialize Olark\n\nBefore using Olark you must initialize it.\nThe most convenient way is to call the `OlarkInit` function of the `olark`\nservice in your `Application` route:\n\n```js\nimport Ember from 'ember';\nconst {\n\tinject: {\n\t\tservice\n\t}\n}\nexport default Ember.Route.extend({\n  olark: service(),\n\n  beforeModel() {\n    this.get('olark').OlarkInit();\n  }\n})\n```\n\n### Usage example\n\n```js\nimport Ember from 'ember';\n\nexport default Ember.Route.extend({\n  olark: Ember.inject.service(),\n\n  actions: {\n\t\topenHelp() {\n\t\t\tconst olark = this.get('olark');\n\n\t\t\tolark.on(\"expand\",() =\u003e {\n\t\t\t\tEmber.debug(\"Olark Expanded!\");\n\t\t\t});\n\n\t\t\tolark.expandBox();\n\t\t},\n\t\tcloseHelp() {\n\t\t\tconst olark = this.get('olark');\n\n\t\t\tolark.on(\"shrink\",() =\u003e {\n\t\t\t\tEmber.debug(\"Olark Shrunk!\");\n\t\t\t});\n\n\t\t\tolark.shrinkBox();\n\t\t}\n\t}\n});\n```\n\n## Running Tests\n\nBefore running tests, substitute any occurence of YOUR IDENTITY KEY in `tests/unit/services/olark-test.js` with your YOUR IDENTITY KEY.\n\n* `ember test`\n* `ember test --server`\n\n## Building\n\n* `ember build`\n\nFor more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfrux%2Fember-cli-olark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfrux%2Fember-cli-olark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfrux%2Fember-cli-olark/lists"}