Démarrage
Copiez un prompt de configuration avec les étapes d'installation et le guide Markdown complet pour ce plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-intercom`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/intercom/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Installation
Section intitulée « Installation »bun add @capgo/capacitor-intercombunx cap syncImporter
Section intitulée « Importer »import { CapgoIntercom } from '@capgo/capacitor-intercom';API : Présentation
Section intitulée “API : Présentation”loadWithKeys
Section intitulée “loadWithKeys”Initialiser Intercom avec les clés API en temps de exécution. Utilisez cela si vous préférez ne pas configurer les clés dans capacitor.config.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({} as IntercomLoadOptions);registerIdentifiedUser
Section intitulée “registerIdentifiedUser”Enregistrer un utilisateur connu avec Intercom. Au moins l'un des identifiants utilisateur ou email doit être fourni.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({} as IntercomIdentifiedUserOptions);registerUnidentifiedUser
Section intitulée “registerUnidentifiedUser”Enregistrer un utilisateur anonyme avec Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();Mettre à jour les attributs de l'utilisateur dans Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.updateUser({} as IntercomUserUpdateOptions);Déconnecter l'utilisateur d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();Enregistrer un événement personnalisé dans Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({} as IntercomLogEventOptions);displayMessenger
Section intitulée « affichage du messager »Ouvrir le messager d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
Section intitulée « displayMessageComposer »Ouvrez le compositeur de message avec un message prérempli.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({} as IntercomMessageComposerOptions);displayHelpCenter
Section intitulée « displayHelpCenter »Ouvrez le centre d'aide d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();hideMessenger
Section intitulée « hideMessenger »Cacher le messager d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideMessenger();displayLauncher
Section intitulée « displayLauncher »Afficher le bouton de lancement d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();hideLauncher
Section intitulée “hideLauncher”Cacher le bouton de lancement d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideLauncher();displayInAppMessages
Section intitulée “displayInAppMessages”Activer les messages en application d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();hideInAppMessages
Section intitulée “hideInAppMessages”Désactiver les messages en application d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();displayCarousel
Section intitulée “displayCarousel”Afficher un carrousel spécifique d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({} as IntercomCarouselOptions);displayArticle
Section intitulée “displayArticle”Afficher un article Intercom spécifique.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({} as IntercomArticleOptions);displaySurvey
Section intitulée “displaySurvey”Afficher un sondage Intercom spécifique.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({} as IntercomSurveyOptions);setUserHash
Section intitulée “setUserHash”Définir la signature HMAC pour la vérification d'identité.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({} as IntercomUserHashOptions);setUserJwt
Section intitulée “setUserJwt”Définir le JWT pour l'authentification sécurisée du messager.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({} as IntercomUserJwtOptions);setBottomPadding
Section intitulée « setBottomPadding »Définir l'espacement inférieur pour l'interface utilisateur de messagerie Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({} as IntercomBottomPaddingOptions);sendPushTokenToIntercom
Section intitulée « sendPushTokenToIntercom »Envoyer un jeton de notification push à Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({} as IntercomPushTokenOptions);receivePush
Section intitulée « receivePush »Gérer une notification push reçue d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({} as IntercomPushNotificationData);getUnreadConversationCount
Section intitulée « getUnreadConversationCount »Obtenir le nombre de conversations non lues pour l'utilisateur actuel.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.getUnreadConversationCount();Référence de type
Référence de typeIntercomLoadOptions
Options de chargement Intercomexport interface IntercomLoadOptions { appId?: string; apiKeyIOS?: string; apiKeyAndroid?: string;}IntercomIdentifiedUserOptions
Options d'utilisateur identifié Intercomexport interface IntercomIdentifiedUserOptions { userId?: string; email?: string;}IntercomUserUpdateOptions
Options d'actualisation d'utilisateur Intercomexport interface IntercomUserUpdateOptions { userId?: string; email?: string; name?: string; phone?: string; languageOverride?: string; customAttributes?: { [key: string]: any }; companies?: IntercomCompany[];}IntercomLogEventOptions
Options d'événement de journal Intercomexport interface IntercomLogEventOptions { name: string; data?: { [key: string]: any };}IntercomMessageComposerOptions
Options de composition de message Intercomexport interface IntercomMessageComposerOptions { message: string;}IntercomCarouselOptions
Section intitulée « Options de carousel Intercom »export interface IntercomCarouselOptions { carouselId: string;}IntercomArticleOptions
Section intitulée « Options d'article Intercom »export interface IntercomArticleOptions { articleId: string;}IntercomSurveyOptions
Section intitulée « Options de sondage Intercom »export interface IntercomSurveyOptions { surveyId: string;}IntercomUserHashOptions
Section intitulée « Options d'identifiant d'utilisateur Intercom »export interface IntercomUserHashOptions { hmac: string;}IntercomUserJwtOptions
Section intitulée « Options de jeton d'utilisateur Intercom »export interface IntercomUserJwtOptions { jwt: string;}IntercomBottomPaddingOptions
Section intitulée « Options de marge inférieure Intercom »export interface IntercomBottomPaddingOptions { value: number;}IntercomPushTokenOptions
Section intitulée « IntercomPushTokenOptions »export interface IntercomPushTokenOptions { value: string;}Source de Vérité
Section intitulée « Source de Vérité »Cette page est générée à partir du plugin. src/definitions.tsRe-run la synchronisation lorsque le public API change en amont.