https://github.com/brendan-rius/ember-cli-crisp
Crisp integration in Ember
https://github.com/brendan-rius/ember-cli-crisp
Last synced: about 1 month ago
JSON representation
Crisp integration in Ember
- Host: GitHub
- URL: https://github.com/brendan-rius/ember-cli-crisp
- Owner: brendan-rius
- License: mit
- Created: 2016-09-22T07:27:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-30T22:14:33.000Z (almost 8 years ago)
- Last Synced: 2025-02-27T20:53:08.695Z (2 months ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Ember-cli-crisp
[Crisp](https://crisp.im/en/) integration for Ember.
## Installation
```bash
ember install ember-cli-crisp
```## Configuration
Place this in your `config/environment.js`:
```javascript
ENV['crisp'] = {
WEBSITE_ID: 'YOUR_WEBSITE_ID_HERE'
};
```You can get your website ID here by getting your chatbox code here : https://app.crisp.im/settings/websites
The code should look like:
```
CRISP_WEBSITE_ID = "8aaaaac5-e1f7-4443-9f83-2545361580ft";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.im/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();
```Here, `8aaaaac5-e1f7-4443-9f83-2545361580ft` is the website ID.
## Usage
The addon creates a service named `crisp` that you can use like so:
```javascript
import Ember from "ember";export default Ember.Controller.extend({
crisp: Ember.inject.service(),actions: {
myAction() {
this.get('crisp').open();
}
}
});```
The defined methods are:
* toggle()
* sendMessage(type, content)
* isOpen()
* isClosed()
* isVisible()
* isSmall()
* isLarge()
* isAvailable()
* isLarge()
* getIdentifier()
* getData(key)
* getEmail()
* getNickname()
* setData(key , value)
* setEmail(email)
* setNickname(nickname)[see more details in the official documentation.](https://help.crisp.im/answer/which-crisp-events-are-available/)
More to come soon.