Skip to content

Cap-go/capacitor-crisp

Repository files navigation

capacitor-crisp

Capgo - Instant updates for capacitor

Crisp native SDK for capacitor

Install

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(data: { websiteID: string; }) => Promise<void>
Param Type
data { websiteID: string; }

openMessenger()

openMessenger() => Promise<void>

setTokenID(...)

setTokenID(data: { tokenID: string; }) => Promise<void>
Param Type
data { tokenID: string; }

setUser(...)

setUser(data: { nickname?: string; phone?: string; email?: string; avatar?: string; }) => Promise<void>
Param Type
data { nickname?: string; phone?: string; email?: string; avatar?: string; }

pushEvent(...)

pushEvent(data: { name: string; color: eventColor; }) => Promise<void>
Param Type
data { name: string; color: eventColor; }

setCompany(...)

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

setInt(...)

setInt(data: { key: string; value: number; }) => Promise<void>
Param Type
data { key: string; value: number; }

setString(...)

setString(data: { key: string; value: string; }) => Promise<void>
Param Type
data { key: string; value: string; }

sendMessage(...)

sendMessage(data: { value: string; }) => Promise<void>
Param Type
data { value: string; }

setSegment(...)

setSegment(data: { segment: string; }) => Promise<void>
Param Type
data { segment: string; }

reset()

reset() => Promise<void>

Type Aliases

eventColor

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