install-messenger
Install the Intercom Messenger on a website or web application with secure JWT-based identity verification. Generates backend and frontend code for React…
от CognitionAI★ 42 звезды на GitHub
Установить install-messenger в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Install Intercom Messenger
Help the user install the Intercom Messenger on their website or application with JWT-based identity verification. This is the secure default — it prevents user impersonation by cryptographically signing user identity on the server.
Only use the insecure (non-JWT) installation if the user explicitly asks for an "insecure installation". Never default to it.
Requirements
Gather these from the user before proceeding:
Workspace ID (also called App ID) — A short alphanumeric string like
abc12345.- Found on the Intercom Messenger install page
- Or in the URL bar:
https://app.intercom.com/a/apps/<workspace_id>/...
Identity Verification Secret (also called Messenger API Secret) — Found on the Messenger Security page. This is the HMAC secret used to sign JWTs. It must never appear in frontend code.
Ask the user for both values. Do not proceed without the Workspace ID. If they don't have the Identity Verification Secret yet, direct them to the Messenger Security page to enable it.
In all generated code, replace YOUR_WORKSPACE_ID with the user's actual Workspace ID. Do not leave placeholders — substitute the real values they provided.
Installation Overview
The secure installation has two parts:
- Backend: Create an API endpoint that generates a signed JWT for the current authenticated user
- Frontend: Boot the Messenger with the JWT from the backend
Always implement both parts. The backend generates the JWT; the frontend passes it to the Messenger.
Step 1: Backend — JWT Generation Endpoint
Create a server-side endpoint that the frontend calls to get a signed JWT for the currently authenticated user. The JWT must be signed with HS256 using the Identity Verification Secret.
Required JWT Claims
| Claim | Required | Description |
|---|---|---|
user_id |
Yes | Stable, unique identifier for the user. Must match across sessions. |
email |
Recommended | User's email address |
name |
Recommended | User's display name |
exp |
Recommended | Expiration timestamp (Unix seconds). Use short-lived tokens — 2 hours is reasonable. |
Important: user_id is mandatory. If multiple users share the same email and you only pass email without user_id, Intercom will reject the request with a conflict error.
Node.js / Express Example
const jwt = require('jsonwebtoken');
const INTERCOM_SECRET = process.env.INTERCOM_IDENTITY_SECRET; // Never hardcode this
app.get('/api/intercom-jwt', requireAuth, (req, res) => {
const token = jwt.sign(
{
user_id: req.user.id,
email: req.user.email,
name: req.user.name,
exp: Math.floor(Date.now() / 1000) + (2 * 60 * 60), // 2 hours
},
INTERCOM_SECRET,
{ algorithm: 'HS256' }
);
res.json({ token });
});
For Python (Flask/Django), PHP, and Ruby/Rails examples, see references/backend-examples.md. The pattern is identical across languages.
Adapt the example to the user's backend language and framework. The key requirements are:
- The endpoint is authenticated (only the logged-in user can get their own JWT)
- The secret comes from an environment variable, never hardcoded
- The token includes
user_idand has a short expiration
Step 2: Frontend — Boot Messenger with JWT
The frontend fetches the JWT from the backend and passes it to the Messenger via intercom_user_jwt.
Basic JavaScript (No Framework)
Add before the closing </body> tag:
<script>
// Fetch JWT from your backend, then boot the Messenger
fetch('/api/intercom-jwt', { credentials: 'include' })
.then(res => res.json())
.then(({ token }) => {
window.Intercom('boot', {
app_id: 'YOUR_WORKSPACE_ID',
intercom_user_jwt: token,
});
});
</script>
<script>
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/YOUR_WORKSPACE_ID';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
</script>
Anonymous Visitors
For unauthenticated pages, boot without a JWT: Intercom('boot', { app_id: 'YOUR_WORKSPACE_ID' }). Intercom tracks anonymous visitors as leads.
Framework-Specific Installation
If the user is using React, Next.js, Vue.js, Angular, Ember, or another SPA framework, refer to `references
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/backend-examples.md
- references/framework-guides.md
FAQ
Что делает скилл install-messenger?
Install the Intercom Messenger on a website or web application with secure JWT-based identity verification. Generates backend and frontend code for React, Next.js, Vue.js, Angular, Ember, and plain JavaScript. Supports Node.js, Python (Flask/Django), PHP, and Ruby backends. Use when the user asks to "install Intercom", "add the Intercom Messenger", "set up Intercom chat widget", "add customer chat to my website", or "integrate Intercom".
Как установить скилл install-messenger?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл install-messenger запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…