시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드가 포함된 설정 프롬프트를 복사하세요.
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.
AI-Assisted Setup으로 플러그인을 설치할 수 있습니다. 다음 명령어로 AI 도구에 Capgo 스킬을 추가하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins그런 다음 아래 프롬프트를 사용하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intercom` plugin in my project.수동 설정을 선호한다면, 다음 명령어를 실행하여 플러그인을 설치하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-intercombunx cap sync가져오기
“Import” 섹션import { CapgoIntercom } from '@capgo/capacitor-intercom';빠른 시작
“빠른 시작” 섹션Intercom을 다음에서 설정하거나 capacitor.config 또는 다음을 호출하세요: loadWithKeys() 아래 API보다 먼저.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({ appId: 'your-app-id', apiKeyIOS: 'ios-api-key', apiKeyAndroid: 'android-api-key',});await CapgoIntercom.registerIdentifiedUser({ userId: '42', email: 'user@example.com' });await CapgoIntercom.displayMessenger();예시: 도움말 센터 문서
“예시: 도움말 센터 문서” 섹션await CapgoIntercom.displayArticle({ articleId: '12345' });예시: 읽지 않음 배지
“예시: 읽지 않은 배지” 섹션await CapgoIntercom.addListener('unreadCountDidChange', ({ count }) => { setBadge(count);});자주 하는 실수
“흔한 실수” 섹션- 키: 호출
loadWithKeys()또는 다른 API를 호출하기 전에 Intercom 키를 설정하세요. - 로그아웃: 호출
logout()앱 사용자가 로그아웃할 때 신원이 유출되지 않도록 하세요. - 웹: messenger API는 네이티브에서만 지원됩니다.
API 개요
“API 개요” 섹션loadWithKeys
“loadWithKeys” 섹션런타임에 API 키를 사용하여 Intercom을 초기화합니다. capacitor.config에서 키를 설정하고 싶지 않은 경우 이 방법을 사용하세요.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({ appId: 'app-id-123', apiKeyIOS: 'api-key-ios', apiKeyAndroid: 'api-key-android',});registerIdentifiedUser
“registerIdentifiedUser” 섹션Intercom에 식별된 사용자를 등록합니다. userId 또는 email 중 하나 이상을 제공해야 합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({ userId: 'user-id-123', email: 'user@example.com',});registerUnidentifiedUser
“registerUnidentifiedUser” 섹션익명 사용자를 Intercom에 등록합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();updateUser
“updateUser” 섹션Intercom의 사용자 속성을 업데이트합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.updateUser({ userId: 'user-id-123' });logout
“logout” 섹션Intercom에서 사용자를 로그아웃합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();logEvent
“logEvent” 섹션Intercom에 커스텀 이벤트를 기록합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({ name: 'example' });displayMessenger
“displayMessenger” 섹션Intercom messenger를 엽니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
“displayMessageComposer” 섹션메시지가 미리 입력된 상태로 message composer를 엽니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({ message: 'Hello from Capacitor' });displayHelpCenter
“displayHelpCenter” 섹션Intercom 도움말 센터를 엽니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();hideMessenger
“hideMessenger” 섹션Intercom 메신저를 숨깁니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideMessenger();displayLauncher
“displayLauncher” 섹션Intercom 런처 버튼을 표시합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();hideLauncher
“hideLauncher” 섹션Intercom 런처 버튼을 숨깁니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideLauncher();displayInAppMessages
“displayInAppMessages” 섹션Intercom 인앱 메시지를 활성화합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();hideInAppMessages
“hideInAppMessages” 섹션Intercom 인앱 메시지를 비활성화합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();displayCarousel
“displayCarousel” 섹션특정 Intercom 캐러셀을 표시합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({ carouselId: 'carousel-id-123' });displayArticle
“displayArticle” 섹션특정 Intercom 아티클을 표시합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({ articleId: 'article-id-123' });displaySurvey
“displaySurvey” 섹션특정 Intercom 설문조사를 표시합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({ surveyId: 'survey-id-123' });setUserHash
“setUserHash” 섹션본인 확인을 위한 HMAC을 설정합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({ hmac: 'hmac' });setUserJwt
“setUserJwt” 섹션보안 메신저 인증을 위한 JWT를 설정합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({ jwt: 'jwt' });setBottomPadding
“setBottomPadding” 섹션Intercom 메신저 UI의 하단 패딩을 설정합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({ value: 1 });sendPushTokenToIntercom
“sendPushTokenToIntercom” 섹션Intercom으로 푸시 알림 토큰을 전송합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({ value: 'value' });receivePush
“receivePush” 섹션수신된 Intercom 푸시 알림을 처리합니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({});getUnreadConversationCount
“getUnreadConversationCount” 섹션현재 사용자의 읽지 않은 대화 수를 가져옵니다.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
const result = await CapgoIntercom.getUnreadConversationCount();console.log(result);타입 레퍼런스
“타입 참조” 섹션IntercomLoadOptions
“IntercomLoadOptions” 섹션export interface IntercomLoadOptions { appId?: string; apiKeyIOS?: string; apiKeyAndroid?: string;}IntercomIdentifiedUserOptions
“IntercomIdentifiedUserOptions” 섹션export interface IntercomIdentifiedUserOptions { userId?: string; email?: string;}IntercomUserUpdateOptions
“IntercomUserUpdateOptions” 섹션export interface IntercomUserUpdateOptions { userId?: string; email?: string; name?: string; phone?: string; languageOverride?: string; customAttributes?: { [key: string]: any }; companies?: IntercomCompany[];}IntercomLogEventOptions
“IntercomLogEventOptions” 섹션export interface IntercomLogEventOptions { name: string; data?: { [key: string]: any };}IntercomMessageComposerOptions
“IntercomMessageComposerOptions” 섹션export interface IntercomMessageComposerOptions { message: string;}IntercomCarouselOptions
“IntercomCarouselOptions” 섹션export interface IntercomCarouselOptions { carouselId: string;}IntercomArticleOptions
“IntercomArticleOptions” 섹션export interface IntercomArticleOptions { articleId: string;}IntercomSurveyOptions
“IntercomSurveyOptions” 섹션export interface IntercomSurveyOptions { surveyId: string;}IntercomUserHashOptions
“IntercomUserHashOptions” 섹션export interface IntercomUserHashOptions { hmac: string;}IntercomUserJwtOptions
“IntercomUserJwtOptions” 섹션export interface IntercomUserJwtOptions { jwt: string;}IntercomBottomPaddingOptions
“IntercomBottomPaddingOptions” 섹션export interface IntercomBottomPaddingOptions { value: number;}IntercomPushTokenOptions
“IntercomPushTokenOptions” 섹션export interface IntercomPushTokenOptions { value: string;}Source of Truth
“Source Of Truth” 섹션이 페이지는 플러그인의 src/definitions.tsupstream에서 public API가 변경되면 sync를 다시 실행하세요.
시작하기 다음 단계
“Getting Started에서 계속하기” 섹션사용 중이라면 시작하기 대시보드 및 API 운영을 계획하려면, 이를 다음과 연결하세요 @capgo/capacitor-intercom 사용하기 @capgo/capacitor-intercom를 사용하여 Native Build 기능을 구현하려면, API 개요 구현 세부 사항은 API 개요에서 소개 구현 세부 사항은 소개에서 API 키 API Keys의 구현 세부 사항은, 기기 Devices의 구현 세부 사항은.