Démarrage
Copiez un prompt de configuration avec les étapes d'installation et la guide markdown complète 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.
Installer
Section intitulée « Installer »Vous pouvez utiliser notre configuration assistée par l'IA pour installer le plugin. Ajoutez les Capgo compétences à votre outil IA à l'aide de la commande suivante :
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsEnsuite, utilisez la prompt suivante :
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intercom` plugin in my project.Si vous préférez la configuration manuelle, installez le plugin en exécutant les commandes suivantes et suivez les instructions spécifiques à la plateforme ci-dessous :
bun add @capgo/capacitor-intercombunx cap syncImporter
Section intitulée « Importer »import { CapgoIntercom } from '@capgo/capacitor-intercom';API Présentation
Titre de la section « API Présentation »loadWithKeys
Titre de la section « loadWithKeys »Initialisez Intercom avec les API clés au moment de l'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
Titre de la section « enregistrerUnUtilisateurIdentifié »Enregistrer un utilisateur connu avec Intercom. Au moins l'un des identifiants d'utilisateur ou de l'adresse e-mail doit être fourni.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({} as IntercomIdentifiedUserOptions);registerUnidentifiedUser
Titre de la section « enregistrerUnUtilisateurNonIdentifié »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);Se déconnecter de l'utilisateur de Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();logEvent
Section intitulée « logEvent »Enregistrer un événement personnalisé dans Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({} as IntercomLogEventOptions);displayMessenger
Section intitulée « afficher le messager »Ouvrir le messager Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
Section intitulée « afficher le compositeur de message »Ouvrez le compositeur de message avec un message prérempli.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({} as IntercomMessageComposerOptions);displayHelpCenter
Sous-section intitulée « afficher le centre d'aide »Ouvrez le centre d'aide Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();hideMessenger
Sous-section intitulée « masquer le messager »Cacher le messager Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideMessenger();displayLauncher
Sous-section intitulée « afficher le bouton de lancement »Afficher le bouton de lancement Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();Masquer le bouton d'activation d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideLauncher();displayInAppMessages
Section intitulée « afficher les messages dans l'application »Activer les messages dans l'application provenant d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();hideInAppMessages
Section intitulée « masquer les messages dans l'application »Désactiver les messages dans l'application provenant d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();Afficher un carrousel spécifique d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({} as IntercomCarouselOptions);displayArticle
Section intitulée « afficher un article »Afficher un article Intercom spécifique.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({} as IntercomArticleOptions);displaySurvey
Sous-section intitulée « displaySurvey »Afficher un sondage Intercom spécifique.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({} as IntercomSurveyOptions);setUserHash
Sous-section intitulée « setUserHash »Configurer l'HMAC pour la vérification d'identité.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({} as IntercomUserHashOptions);setUserJwt
Sous-section intitulée « setUserJwt »Configurer JWT pour l'authentification sécurisée du messager.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({} as IntercomUserJwtOptions);setBottomPadding
Sous-section intitulée « setBottomPadding »Définissez la marge inférieure pour l'interface utilisateur de messagerie Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({} as IntercomBottomPaddingOptions);sendPushTokenToIntercom
Section intitulée « envoyerUnjetTokenVersIntercom »Envoyer un jeton de notification push vers Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({} as IntercomPushTokenOptions);receivePush
Section intitulée « recevoirUnJet »Gérer une notification push reçue par Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({} as IntercomPushNotificationData);getUnreadConversationCount
Section intitulée « obtenirLeCompteurDeConversationsNonLues »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
Section intitulée « Type Reference »IntercomLoadOptions
Section intitulée « Options de chargement Intercom »export interface IntercomLoadOptions { appId?: string; apiKeyIOS?: string; apiKeyAndroid?: string;}IntercomIdentifiedUserOptions
Section intitulée « Options d'utilisateur identifié Intercom »export interface IntercomIdentifiedUserOptions { userId?: string; email?: string;}IntercomUserUpdateOptions
Section intitulée « Options de mise à jour d'utilisateur Intercom »export interface IntercomUserUpdateOptions { userId?: string; email?: string; name?: string; phone?: string; languageOverride?: string; customAttributes?: { [key: string]: any }; companies?: IntercomCompany[];}IntercomLogEventOptions
Section intitulée « Options d'événement de journal Intercom »export interface IntercomLogEventOptions { name: string; data?: { [key: string]: any };}IntercomMessageComposerOptions
Section intitulée « Options de composition de message Intercom »export interface IntercomMessageComposerOptions { message: string;}IntercomCarouselOptions
Section intitulée « Options de carrousel 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 de hachage d'utilisateur Intercom »export interface IntercomUserHashOptions { hmac: string;}IntercomUserJwtOptions
Section intitulée « Options de jeton JWT d'utilisateur Intercom »export interface IntercomUserJwtOptions { jwt: string;}IntercomBottomPaddingOptions
Section intitulée « Options de padding en bas Intercom »export interface IntercomBottomPaddingOptions { value: number;}IntercomPushTokenOptions
Section intitulée « Options de jeton de poussée Intercom »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’s src/definitions.tsRe-générez la synchronisation lorsque le public API change en amont.
Continuez de la section « Getting Started »
Section intitulée « Continuez de la section « Getting Started » »Si vous utilisez Getting Started pour planifier le tableau de bord et les opérations API, connectez-l’avec Utilisez @capgo/capacitor-intercom pour la capacité native dans Utilisez @capgo/capacitor-intercom, API Présentation pour les détails d'implémentation dans API Présentation Introduction pour les détails d'implémentation dans Introduction API Clés pour les détails d'implémentation dans API Clés, et Appareils pour les détails d'implémentation dans Appareils.