Intercom Plugin for Capacitor
npm install @sencrop/capacitor-intercomIntercom Plugin for Capacitor
``bash`
npm install @sencrop/capacitor-intercom
npx cap sync
* initialize(...)
* loginIdentifiedUser(...)
* loginUnidentifiedUser()
* updateUser(...)
* logout()
* logEvent(...)
* displayMessenger()
* displayMessageComposer(...)
* displayHelpCenter()
* displayArticle(...)
* hideMessenger()
* displayLauncher()
* hideLauncher()
* setCustomAttributes(...)
* displaySurvey(...)
* Interfaces
* Type Aliases
`typescript`
initialize(config: IntercomSettings) => void
| Param | Type |
| ------------ | ------------------------------------------------------------- |
| config | IntercomSettings |
--------------------
`typescript`
loginIdentifiedUser(identity: IntercomIdentity) => Promise
| Param | Type |
| -------------- | ------------------------------------------------------------- |
| identity | IntercomIdentity |
--------------------
`typescript`
loginUnidentifiedUser() => Promise
--------------------
`typescript`
updateUser(user: IntercomUser) => Promise
| Param | Type |
| ---------- | ----------------------------------------------------- |
| user | IntercomUser |
--------------------
`typescript`
logout() => Promise
--------------------
`typescript`
logEvent(event: IntercomEvent) => Promise
| Param | Type |
| ----------- | ------------------------------------------------------- |
| event | IntercomEvent |
--------------------
`typescript`
displayMessenger() => Promise
--------------------
`typescript`
displayMessageComposer(message: IntercomMessage) => Promise
| Param | Type |
| ------------- | ----------------------------------------------------------- |
| message | IntercomMessage |
--------------------
`typescript`
displayHelpCenter() => Promise
--------------------
`typescript`
displayArticle(article: IntercomArticle) => Promise
| Param | Type |
| ------------- | ----------------------------------------------------------- |
| article | IntercomArticle |
--------------------
`typescript`
hideMessenger() => Promise
--------------------
`typescript`
displayLauncher() => Promise
--------------------
`typescript`
hideLauncher() => Promise
--------------------
`typescript`
setCustomAttributes(payload: IntercomCustomAttributes) => Promise
| Param | Type |
| ------------- | ----------------------------------------------------------------------------- |
| payload | IntercomCustomAttributes |
--------------------
`typescript`
displaySurvey(survey: IntercomSurvey) => Promise
| Param | Type |
| ------------ | --------------------------------------------------------- |
| survey | IntercomSurvey |
--------------------
#### IntercomSettings
| Prop | Type |
| ------------------------------ | ----------------------------------------------------------- |
| app_id | string |
| api_base | string |
| alignment | string |
| custom_launcher_selector | string |
| hide_default_launcher | boolean |
| horizontal_padding | number |
| session_duration | number |
| vertical_padding | number |
| action_color | string |
| background_color | string |
| email | string |
| phone | string |
| created_at | number |
| name | string |
| user_id | string |
| user_hash | string |
| unsubscribed_from_emails | boolean |
| language_override | string |
| utm_campaign | string |
| utm_content | string |
| utm_medium | string |
| utm_source | string |
| utm_term | string |
| company | IntercomCompany |
| companies | IntercomCompany[] |
| avatar | IntercomAvatar |
#### IntercomCompany
| Prop | Type |
| ----------------------- | ----------------------------- |
| name | string |
| id | string \| number |
| company_id | string \| number |
| created_at | number |
| remote_created_at | number |
| plan | string |
| monthly_spend | number |
| user_count | number |
| size | number |
| website | string |
| industry | string |
#### IntercomAvatar
| Prop | Type |
| --------------- | --------------------- |
| type | 'avatar' |
| image_url | string |
#### IntercomIdentity
| Prop | Type |
| -------------- | ------------------- |
| userId | string |
| email | string |
| userHash | string |
#### IntercomUser
| Prop | Type |
| -------------- | ------------------- |
| email | string |
| phone | string |
| name | string |
| language | string |
#### IntercomEvent
| Prop | Type |
| ---------- | ------------------- |
| name | string |
| data | any |
#### IntercomMessage
| Prop | Type |
| ------------- | ------------------- |
| content | string |
#### IntercomArticle
| Prop | Type |
| -------- | ------------------- |
| id | number |
#### IntercomCustomAttributes
| Prop | Type |
| ---------------- | ------------------------------------------------------------------------------------ |
| attributes | Record<string, number \| string \| boolean> |
#### IntercomSurvey
| Prop | Type |
| -------- | ------------------- |
| id` | number |
#### Record
Construct a type with a set of properties K of type T
{
[P in K]: T;
}