Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Cap-go/capacitor-crisp

Crisp native SDK for capacitor
https://github.com/Cap-go/capacitor-crisp

android capacitor capacitor-plugin crisp ionic ios

Last synced: 24 days ago
JSON representation

Crisp native SDK for capacitor

Awesome Lists containing this project

README

        

# capacitor-crisp
Capgo - Instant updates for capacitor


➡️ Get Instant updates for your App with Capgo 🚀


Fix your annoying bug now, Hire a Capacitor expert 💪



Crisp native SDK for capacitor

## Install

```bash
npm install @capgo/capacitor-crisp
npx cap sync
```

## Init

Call configure in your code Before any other method :
```
import { CapacitorCrisp } from '@capgo/capacitor-crisp';

CapacitorCrisp.configure({websiteID: '******-****-****-****-********'})
```
### iOS

To enable your users to take and upload photos to the chat as well as download photos to their photo library, add :

Privacy - Camera Usage Description (NSCameraUsageDescription)

Privacy - Photo Library Additions Usage Description (NSPhotoLibraryAddUsageDescription)

to your app's Info.plist.

### Android Integration
Nothing special to do.

## Open chatbox

```
import { CapacitorCrisp } from '@capgo/capacitor-crisp';

CapacitorCrisp.openMessenger()
```
## API

* [`configure(...)`](#configure)
* [`openMessenger()`](#openmessenger)
* [`setTokenID(...)`](#settokenid)
* [`setUser(...)`](#setuser)
* [`pushEvent(...)`](#pushevent)
* [`setCompany(...)`](#setcompany)
* [`setInt(...)`](#setint)
* [`setString(...)`](#setstring)
* [`sendMessage(...)`](#sendmessage)
* [`setSegment(...)`](#setsegment)
* [`reset()`](#reset)
* [Type Aliases](#type-aliases)

### configure(...)

```typescript
configure(data: { websiteID: string; }) => Promise
```

| Param | Type |
| ---------- | ----------------------------------- |
| **`data`** | { websiteID: string; } |

--------------------

### openMessenger()

```typescript
openMessenger() => Promise
```

--------------------

### setTokenID(...)

```typescript
setTokenID(data: { tokenID: string; }) => Promise
```

| Param | Type |
| ---------- | --------------------------------- |
| **`data`** | { tokenID: string; } |

--------------------

### setUser(...)

```typescript
setUser(data: { nickname?: string; phone?: string; email?: string; avatar?: string; }) => Promise
```

| Param | Type |
| ---------- | ------------------------------------------------------------------------------------ |
| **`data`** | { nickname?: string; phone?: string; email?: string; avatar?: string; } |

--------------------

### pushEvent(...)

```typescript
pushEvent(data: { name: string; color: eventColor; }) => Promise
```

| Param | Type |
| ---------- | --------------------------------------------------------------------------- |
| **`data`** | { name: string; color: eventColor; } |

--------------------

### setCompany(...)

```typescript
setCompany(data: { name: string; url?: string; description?: string; employment?: [title: string, role: string]; geolocation?: [country: string, city: string]; }) => Promise
```

| Param | Type |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`data`** | { name: string; url?: string; description?: string; employment?: [title: string, role: string]; geolocation?: [country: string, city: string]; } |

--------------------

### setInt(...)

```typescript
setInt(data: { key: string; value: number; }) => Promise
```

| Param | Type |
| ---------- | -------------------------------------------- |
| **`data`** | { key: string; value: number; } |

--------------------

### setString(...)

```typescript
setString(data: { key: string; value: string; }) => Promise
```

| Param | Type |
| ---------- | -------------------------------------------- |
| **`data`** | { key: string; value: string; } |

--------------------

### sendMessage(...)

```typescript
sendMessage(data: { value: string; }) => Promise
```

| Param | Type |
| ---------- | ------------------------------- |
| **`data`** | { value: string; } |

--------------------

### setSegment(...)

```typescript
setSegment(data: { segment: string; }) => Promise
```

| Param | Type |
| ---------- | --------------------------------- |
| **`data`** | { segment: string; } |

--------------------

### reset()

```typescript
reset() => Promise
```

--------------------

### Type Aliases

#### eventColor

"red" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "brown" | "grey" | "black"