14 jours d'essai gratuit illimité. Pas de carte de crédit requise
Copiez un prompt de configuration avec les étapes d'installation et la 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.
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 en utilisant la commande suivante :
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsUtilisez ensuite 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 à votre plateforme ci-dessous.
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 »Initialisez Intercom avec des clés API à l'exécution. Utilisez ce paramètre si vous préférez ne pas configurer les clés dans capacitor.config.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({ appId: 'app-id-123', apiKeyIOS: 'api-key-ios', apiKeyAndroid: 'api-key-android',});registerIdentifiedUser
Section intitulée « registerIdentifiedUser »Inscrire un utilisateur connu avec Intercom. Au moins l'un des champs userId ou email doit être fourni.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({ userId: 'user-id-123', email: 'user@example.com',});registerUnidentifiedUser
Section intitulée « registerUnidentifiedUser »Inscrire un utilisateur anonyme avec Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();updateUser
Section intitulée « updateUser »Update user attributes in Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.updateUser({ userId: 'user-id-123' });Déconnecter 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({ name: 'example' });displayMessenger
Section intitulée « displayMessenger »Ouvrir le messager Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
Section intitulée « displayMessageComposer »Ouvrir le compositeur de message avec un message prérempli.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({ message: 'Hello from Capacitor' });displayHelpCenter
Section intitulée « displayHelpCenter »Ouvrir le centre d'aide d'Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();hideMessenger
Section intitulée « masquerMessager »Masquer le messager Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideMessenger();displayLauncher
Section intitulée « afficherLanceur »Afficher le bouton de lancement Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();hideLauncher
Section intitulée « masquerLanceur »Masquer le bouton de lancement Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideLauncher();displayInAppMessages
Section intitulée « afficherMessagesDansLApplication »Activer les messages dans l'application Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();hideInAppMessages
Cacher les messages de l'applicationDésactiver les messages en application de Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();displayCarousel
Section intitulée « afficher le carrousel »Afficher un carrousel spécifique de Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({ carouselId: 'carousel-id-123' });displayArticle
Section intitulée « afficher l'article »Afficher un article spécifique de Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({ articleId: 'article-id-123' });displaySurvey
Section intitulée « afficher l'enquête »Afficher une enquête spécifique de Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({ surveyId: 'survey-id-123' });setUserHash
Section intitulée « setUserHash »Fixez l'HMAC pour la vérification d'identité.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({ hmac: 'hmac' });setUserJwt
Section intitulée « setUserJwt »Fixez le JWT pour l'authentification sécurisée du messager.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({ jwt: 'jwt' });setBottomPadding
Section intitulée « setBottomPadding »Fixez la marge inférieure pour l'interface utilisateur du messager Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({ value: 1 });sendPushTokenToIntercom
Section intitulée « sendPushTokenToIntercom »Envoyez un jeton de notification push à Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({ value: 'value' });receivePush
Section intitulée “receivePush”Gérer une notification de push reçue par Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({});getUnreadConversationCount
Section intitulée “getUnreadConversationCount”Obtenir le nombre de conversations non lues pour l'utilisateur actuel.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
const result = await CapgoIntercom.getUnreadConversationCount();console.log(result);Référence de type
Section intitulée “Type Reference”IntercomLoadOptions
Section intitulée “IntercomLoadOptions”export interface IntercomLoadOptions { appId?: string; apiKeyIOS?: string; apiKeyAndroid?: string;}IntercomIdentifiedUserOptions
Section intitulée “IntercomIdentifiedUserOptions”export interface IntercomIdentifiedUserOptions { userId?: string; email?: string;}IntercomUserUpdateOptions
Options d'actualisation de l'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 IntercomLogexport 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 diaporama 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
Options d'Utilisateur IntercomHashexport interface IntercomUserHashOptions { hmac: string;}IntercomUserJwtOptions
Option de configuration IntercomUserJwtexport interface IntercomUserJwtOptions { jwt: string;}IntercomBottomPaddingOptions
Options de mise en page inférieure Intercomexport interface IntercomBottomPaddingOptions { value: number;}IntercomPushTokenOptions
Options de jeton de push Intercomexport interface IntercomPushTokenOptions { value: string;}Source de vérité
Section intitulée « Source de vérité »Cette page est générée à partir des paramètres du plugin src/definitions.tsRerunner le synchronisme lorsque les informations publiques API changent en amont.
Continuez de Getting Started
Section intitulée “Continuez de Getting Started”Si vous utilisez Getting Started pour planifier l'interface de bord et les opérations de API, connectez-l’avec Utilisation de @capgo/capacitor-intercom pour la capacité native dans Utilisation de @capgo/capacitor-intercom API Overview pour le détail d'implémentation dans API Overview Introduction pour le détail d'implémentation dans Introduction API Clés pour le détail d'implémentation dans API Clés, et Appareils pour les détails d'implémentation sur les appareils.