Совместный просмотр сайта (Zoom Cobrowse)
Справочник по Zoom Cobrowse SDK: как дать агенту поддержки видеть страницу клиента на сайте, рисовать на ней, скрывать личные поля и помогать с прокруткой.
- Что делает
- Справочник по Zoom Cobrowse SDK: как дать агенту поддержки видеть страницу клиента на сайте, рисовать на ней, скрывать личные поля и помогать с прокруткой.
- Когда брать
- При разработке совместного просмотра страниц на сайте для поддержки клиентов: PIN-коды, аннотации, маскирование данных, удалённая помощь.
- Когда не брать
- Если нужна только видеосвязь или встречи Zoom без совместного просмотра сайта.
- Пример запроса
- Как подключить Zoom Cobrowse на наш сайт, чтобы оператор видел страницу клиента, а номера карт были скрыты?
- Нужно подключить
- терминал, аккаунт разработчика Zoom (Video SDK)
Входит в плагин zoom-plugin. В Cowork и Claude Code можно поставить плагин целиком.
Как включить
- Скачайте архив и распакуйте его.
- Положите папку
zoom-cobrowse-sdkв~/.claude/skills/. - Откройте Claude Code и опишите задачу своими словами: Claude подхватит скилл по описанию.
Текст
---
name: zoom-cobrowse-sdk
description: "Справочный скилл по Zoom Cobrowse SDK. Используй после выбора рабочего процесса совместной поддержки при реализации совместного просмотра в браузере (cobrowsing), инструментов аннотирования, маскирования конфиденциальных данных, удалённой помощи или общего доступа к сессии по PIN-коду."
user-invocable: false
triggers:
- "cobrowse"
- "co-browse"
- "collaborative browsing"
- "agent assist"
- "customer support screen share"
- "zoom cobrowse"
---
Zoom Cobrowse SDK — разработка для веба
Фоновый справочник по совместному просмотру в вебе с помощью Zoom Cobrowse SDK. Используй его, когда рабочий процесс поддержки уже понятен и нужны подробности реализации.
Официальная документация: https://developers.zoom.us/docs/cobrowse-sdk/ Справочник по API: https://marketplacefront.zoom.us/sdk/cobrowse/ Репозиторий быстрого старта: https://github.com/zoom/CobrowseSDK-Quickstart Пример эндпоинта авторизации: https://github.com/zoom/cobrowsesdk-auth-endpoint-sample
Быстрые ссылки
Впервые с Cobrowse SDK? Иди по этому пути:
- [Руководство по началу работы](get-started.md) — полная настройка от учётных данных до первой сессии
- [Жизненный цикл сессии](concepts/session-lifecycle.md) — сценарии клиента и агента
- [Аутентификация JWT](concepts/jwt-authentication.md) — создание токенов и безопасность
- [Интеграция на стороне клиента](examples/customer-integration.md) — встраивание SDK на ваш сайт
- [Интеграция на стороне агента](examples/agent-integration.md) — настройка портала агента (iframe или npm)
Основные понятия:
- [Схема двух ролей](concepts/two-roles-pattern.md) — архитектура клиента и агента
- [Жизненный цикл сессии](concepts/session-lifecycle.md) — создание PIN-кода, подключение, повторное подключение
- [Аутентификация JWT](concepts/jwt-authentication.md) — SDK Key и API Key, role_type, claims
- [Способы распространения](concepts/distribution-methods.md) — CDN и npm (BYOP)
Возможности:
- [Инструменты аннотирования](examples/annotations.md) — рисование, выделение, указка
- [Маскирование конфиденциальных данных](examples/privacy-masking.md) — скрытие чувствительных полей от агентов
- [Удалённая помощь](examples/remote-assist.md) — агент может прокручивать страницу клиента
- [Сохранение сессии между вкладками](examples/multi-tab-persistence.md) — сессия продолжается во всех вкладках
- [Режим BYOP](examples/byop-custom-pin.md) — Bring Your Own PIN (свой PIN-код) при интеграции через npm
Устранение неполадок:
- [Частые проблемы](troubleshooting/common-issues.md) — быстрая диагностика и решения
- [Коды ошибок](troubleshooting/error-codes.md) — полный справочник ошибок
- [CORS и CSP](troubleshooting/cors-csp.md) — настройка политик кросс-доменных запросов и безопасности
- [Совместимость с браузерами](troubleshooting/browser-compatibility.md) — поддерживаемые браузеры и ограничения
- [Пятиминутный чек-лист](RUNBOOK.md) — быстрая предстартовая проверка перед глубокой отладкой
Справочники:
- [Справочник по API](references/api-reference.md) — все методы и события SDK
- [Справочник по настройкам](references/settings-reference.md) — все настройки инициализации
- Сводный указатель — см. раздел ниже в этом файле
Обзор SDK
Zoom Cobrowse SDK — это библиотека JavaScript, которая даёт:
- Совместный просмотр в реальном времени: агент в реальном времени видит действия клиента в его браузере
- Сессии по PIN-коду: безопасный 6-значный PIN-код для соединения клиента с агентом
- Инструменты аннотирования: рисование, выделение, исчезающее перо, прямоугольник, выбор цвета
- Маскирование конфиденциальных данных: маскирование чувствительных полей форм по CSS-селекторам
- Удалённая помощь: агент может прокручивать страницу клиента (с согласия)
- Сохранение сессии между вкладками: сессия продолжается, когда клиент открывает новые вкладки
- Автоматическое переподключение: сессия восстанавливается после обновления страницы (окно в 2 минуты)
- События сессии: события в реальном времени об изменениях состояния сессии
- Требуется HTTPS: защищённые соединения (HTTP работает только на локальных адресах loopback и узлах для локальной разработки)
- Без плагинов: чистый JavaScript, расширения браузера не нужны
Архитектура двух ролей
В Cobrowse есть две разные роли, у каждой свой способ интеграции:
| Роль | role_type | Интеграция | Нужен ли JWT | Назначение |
|---|---|---|---|---|
| Клиент | 1 | Интеграция на сайт (CDN или npm) | Да | Пользователь, который делится своей сессией в браузере |
| Агент | 2 | Iframe (CDN) или npm (только BYOP) | Да | Сотрудник поддержки, который смотрит на страницу клиента и помогает |
Главное: клиент и агент используют разные способы интеграции, но одну и ту же схему аутентификации JWT.
Прочитай это первым (критично)
В демонстрациях для клиента и агента считай единственным PIN-кодом, который видит пользователь, PIN из события клиентского SDK pincode_updated.
- Показывай в интерфейсе одно чётко подписанное значение (например, PIN для поддержки).
- Используй этот же PIN, когда агент подключается к сессии.
- Не показывай пользователям временные и отладочные PIN-коды из предварительных записей на сервере.
Если пренебречь этими правилами, рабочее место агента часто падает с ошибкой Pincode is not found / код 30308.
Типичный рабочий сценарий (самый частый)
Этот сценарий большинство команд реализует первым, и именно его пользователи обычно ждут в демонстрациях:
- Первым сессию начинает клиент (
role_type=1) - Сервер создаёт и записывает сессию
- Сервер возвращает JWT клиента
- SDK клиента запускается и получает PIN-код
- Вторым подключается агент (
role_type=2) - Агент вводит PIN-код клиента
- Сервер проверяет PIN-код и состояние сессии
- Сервер возвращает JWT агента
- Агент открывает iframe рабочего места, размещённый в Zoom (или собственный интерфейс агента на npm в режиме BYOP)
Если в демонстрации есть только один универсальный пользователь «сессии», она неполна для реальной работы с cobrowse.
Предварительные требования
Требования к платформе
- Поддерживаемые браузеры:
- Chrome 80+ ✓
- Firefox 78+ ✓
- Safari 14+ ✓
- Edge 80+ ✓
- Internet Explorer ✗ (не поддерживается)
- Требования к сети:
- Нужен HTTPS (HTTP работает только на loopback-адресах и узлах для локальной разработки)
- Разреши кросс-доменные запросы к
*.zoom.us - Заголовки CSP должны разрешать домены Zoom (см. [руководство по CORS и CSP](troubleshooting/cors-csp.md))
- Сторонние cookie:
- Для переподключения после обновления страницы должны быть включены сторонние cookie
- Режим приватности может ограничивать некоторые функции
Требования к аккаунту Zoom
- Аккаунт Zoom Workplace с SDK Universal Credit
- Приложение Video SDK, созданное в Zoom Marketplace
- Учётные данные Cobrowse SDK со вкладки Cobrowse приложения
Примечание: Cobrowse SDK — это возможность Video SDK (а не отдельный продукт).
Обзор учётных данных
Ты получишь четыре ключа (учётные данные) в Zoom Marketplace → приложение Video SDK → вкладка Cobrowse:
| Учётные данные | Тип | Для чего | Можно ли раскрывать |
|---|---|---|---|
| SDK Key | Публичный | URL CDN, поле app_key в JWT | ✓ Да (на стороне клиента) |
| SDK Secret | Секретный | Подпись JWT | ✗ Нет (только на сервере) |
| API Key | Секретный | Вызовы REST API (необязательно) | ✗ Нет (только на сервере) |
| API Secret | Секретный | Вызовы REST API (необязательно) | ✗ Нет (только на сервере) |
Критично: SDK Key публичный (встроен в URL CDN), а SDK Secret ни в коем случае нельзя раскрывать на стороне клиента.
Быстрый старт
Шаг 1: Получи учётные данные SDK
- Перейди в Zoom Marketplace
- Открой своё приложение Video SDK (или создай его)
- Перейди на вкладку Cobrowse
- Скопируй учётные данные:
- SDK Key
- SDK Secret
- API Key (необязательно)
- API Secret (необязательно)
Шаг 2: Настрой сервер токенов
Разверни серверный эндпоинт для создания JWT. Используй официальный пример:
git clone https://github.com/zoom/cobrowsesdk-auth-endpoint-sample.git
cd cobrowsesdk-auth-endpoint-sample
npm install
# Create .env file
cat > .env << EOF
ZOOM_SDK_KEY=your_sdk_key_here
ZOOM_SDK_SECRET=your_sdk_secret_here
PORT=4000
EOF
npm start
Эндпоинт токена:
// POST https://YOUR_TOKEN_SERVICE_BASE_URL
{
"role": 1, // 1 = customer, 2 = agent
"userId": "user123",
"userName": "John Doe"
}
// Response
{
"token": "eyJhbGciOiJIUzI1NiIs..."
}
Шаг 3: Интеграция на стороне клиента (CDN)
<!DOCTYPE html>
<html>
<head>
<title>Customer - Cobrowse Demo</title>
<script type="module">
const ZOOM_SDK_KEY = 'YOUR_SDK_KEY';
// Load SDK from CDN
(function(r, a, b, f, c, d) {
r[f] = r[f] || { init: function() { r.ZoomCobrowseSDKInitArgs = arguments }};
var fragment = a.createDocumentFragment();
function loadJs(url) {
c = a.createElement(b);
d = a.getElementsByTagName(b)[0];
c["async"] = false;
c.src = url;
fragment.appendChild(c);
}
loadJs(`https://us01-zcb.zoom.us/static/resource/sdk/${ZOOM_SDK_KEY}/js/2.13.2`);
d.parentNode.insertBefore(fragment, d);
})(window, document, "script", "ZoomCobrowseSDK");
</script>
</head>
<body>
<h1>Customer Support</h1>
<button id="cobrowse-btn" disabled>Loading...</button>
<!-- Sensitive fields - will be masked from agent -->
<label>SSN: <input type="text" class="pii-mask" placeholder="XXX-XX-XXXX"></label>
<label>Credit Card: <input type="text" class="pii-mask" placeholder="XXXX-XXXX-XXXX-XXXX"></label>
<script type="module">
let sessionRef = null;
const settings = {
allowAgentAnnotation: true,
allowCustomerAnnotation: true,
piiMask: {
maskCssSelectors: ".pii-mask",
maskType: "custom_input"
}
};
ZoomCobrowseSDK.init(settings, function({ success, session, error }) {
if (success) {
sessionRef = session;
// Listen for PIN code
session.on("pincode_updated", (payload) => {
console.log("PIN Code:", payload.pincode);
// IMPORTANT: this is the PIN agent should use
alert(`Share this PIN with agent: ${payload.pincode}`);
});
// Listen for session events
session.on("session_started", () => console.log("Session started"));
session.on("agent_joined", () => console.log("Agent joined"));
session.on("agent_left", () => console.log("Agent left"));
session.on("session_ended", () => console.log("Session ended"));
document.getElementById("cobrowse-btn").disabled = false;
document.getElementById("cobrowse-btn").innerText = "Start Cobrowse Session";
} else {
console.error("SDK init failed:", error);
}
});
document.getElementById("cobrowse-btn").addEventListener("click", async () => {
// Fetch JWT from your server
const response = await fetch("https://YOUR_TOKEN_SERVICE_BASE_URL", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
role: 1,
userId: "customer_" + Date.now(),
userName: "Customer"
})
});
const { token } = await response.json();
// Start cobrowse session
sessionRef.start({ sdkToken: token });
});
</script>
</body>
</html>
Шаг 4: Интеграция на стороне агента (iframe)
<!DOCTYPE html>
<html>
<head>
<title>Agent Portal</title>
</head>
<body>
<h1>Agent Portal</h1>
<iframe
id="agent-iframe"
width="1024"
height="768"
allow="autoplay *; camera *; microphone *; display-capture *; geolocation *;"
></iframe>
<script>
async function connectAgent() {
// Fetch JWT from your server
const response = await fetch("https://YOUR_TOKEN_SERVICE_BASE_URL", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
role: 2,
userId: "agent_" + Date.now(),
userName: "Support Agent"
})
});
const { token } = await response.json();
// Load Zoom agent portal
const iframe = document.getElementById("agent-iframe");
iframe.src = `https://us01-zcb.zoom.us/sdkapi/zcb/frame-templates/desk?access_token=${token}`;
}
connectAgent();
</script>
</body>
</html>
Шаг 5: Проверь интеграцию
- Открой два разных браузера (или режим инкогнито и обычный)
- Браузер клиента: открой страницу клиента, нажми «Start Cobrowse Session»
- Браузер клиента: запомни показанный 6-значный PIN-код
- Браузер агента: открой страницу агента, введи PIN-код
- Оба браузера: сессия подключается, агент видит страницу клиента
- Проверь функции: аннотации, маскирование данных, удалённая помощь
Ключевые возможности
1. Инструменты аннотирования
Клиент и агент могут рисовать на общем экране:
const settings = {
allowAgentAnnotation: true, // Agent can draw
allowCustomerAnnotation: true // Customer can draw
};
Доступные инструменты:
- Перо (постоянное)
- Исчезающее перо (пропадает через 4 секунды)
- Прямоугольник
- Выбор цвета
- Ластик
- Отмена и повтор
2. Маскирование конфиденциальных данных
Скрывай чувствительные поля от агентов с помощью CSS-селекторов:
const settings = {
piiMask: {
maskType: "custom_input", // Mask specific fields
maskCssSelectors: ".pii-mask, #ssn", // CSS selectors
maskHTMLAttributes: "data-sensitive=true" // HTML attributes
}
};
Поддерживаемое маскирование:
- Текстовые узлы ✓
- Поля форм ✓
- Элементы select ✓
- Изображения ✗ (не поддерживается)
- Ссылки ✗ (не поддерживается)
3. Удалённая помощь
Агент может прокручивать страницу клиента:
const settings = {
remoteAssist: {
enable: true,
enableCustomerConsent: true, // Customer must approve
remoteAssistTypes: ['scroll_page'], // Only scroll supported
requireStopConfirmation: false // Confirmation when stopping
}
};
4. Сохранение сессии между вкладками
Сессия продолжается, когда клиент открывает новые вкладки:
const settings = {
multiTabSessionPersistence: {
enable: true,
stateCookieKey: '$$ZCB_SESSION$$' // Cookie key (base64 encoded)
}
};
Жизненный цикл сессии
Сценарий клиента
- Загрузка SDK → скрипт CDN загружает
ZoomCobrowseSDK - Инициализация →
ZoomCobrowseSDK.init(settings, callback) - Получение JWT → запроси токен у своего сервера (role_type=1)
- Начало сессии →
session.start({ sdkToken }) - Создание PIN-кода → срабатывает событие
pincode_updated - Передача PIN-кода → клиент сообщает агенту 6-значный PIN-код
- Подключение агента → срабатывает событие
agent_joined - Активная сессия → начинается синхронизация в реальном времени
- Завершение сессии →
session.end()или агент уходит
Сценарий агента
- Получение JWT → запроси токен у своего сервера (role_type=2)
- Загрузка iframe → укажи портал агента Zoom вместе с токеном
- Ввод PIN-кода → агент вводит 6-значный PIN-код клиента
- Подключение → срабатывает событие
session_joined - Просмотр сессии → агент видит браузер клиента
- Использование инструментов → аннотации, удалённая помощь, масштаб
- Выход из сессии → нажатие кнопки «Leave Cobrowse»
Восстановление сессии (автоматическое переподключение)
Когда клиент обновляет страницу:
ZoomCobrowseSDK.init(settings, function({ success, session, error }) {
if (success) {
const sessionInfo = session.getSessionInfo();
// Check if session is recoverable
if (sessionInfo.sessionStatus === 'session_recoverable') {
session.join(); // Auto-rejoin previous session
} else {
// Start new session
session.start({ sdkToken });
}
}
});
Окно восстановления: 2 минуты. Через 2 минуты сессия завершается.
Критичные подводные камни и лучшие практики
⚠️ КРИТИЧНО: SDK Secret должен оставаться на сервере
Проблема: разработчики часто случайно встраивают SDK Secret в код фронтенда.
Решение:
- ✓ SDK Key → можно раскрывать (встроен в URL CDN)
- ✗ SDK Secret → никогда не раскрывай (используй для подписи JWT на сервере)
// ❌ WRONG - Secret exposed in frontend
const jwt = signJWT(payload, 'YOUR_SDK_SECRET'); // Security risk!
// ✅ CORRECT - Secret stays on server
const response = await fetch('/api/token', {
method: 'POST',
body: JSON.stringify({ role: 1, userId, userName })
});
const { token } = await response.json();
SDK Key и API Key (разные назначения!)
| Учётные данные | Для чего | Поле JWT |
|---|---|---|
| SDK Key | URL CDN, поле app_key в JWT | app_key: "SDK_KEY" |
| API Key | Вызовы REST API (необязательно) | Не используется в JWT |
Частая ошибка: использовать API Key вместо SDK Key в поле app_key JWT.
Лимиты сессии
| Лимит | Значение | Что происходит |
|---|---|---|
| Клиентов в сессии | 1 | Ошибка 1012: SESSION_CUSTOMER_COUNT_LIMIT |
| Агентов в сессии | 5 | Ошибка 1013: SESSION_AGENT_COUNT_LIMIT |
| Активных сессий на браузер | 1 | Ошибка 1004: SESSION_COUNT_LIMIT |
| Длина PIN-кода | не более 10 символов | Ошибка 1008: SESSION_PIN_INVALID_FORMAT |
Поведение при таймаутах сессии
| Событие | Таймаут | Что происходит |
|---|---|---|
| Агент ждёт клиента | 3 минуты | Сессия завершается автоматически |
| Переподключение после обновления страницы | 2 минуты | Сессия завершается, если переподключения не было |
| Попытки переподключения | не более 2 раз | Сессия завершается после 2 неудачных попыток |
Требование HTTPS
Проблема: SDK не загружается на сайтах с HTTP.
Решение:
- Продакшен: используй HTTPS ✓
- Разработка: используй loopback-адрес для локального тестирования по HTTP ✓
- Разработка: при необходимости используй локальный HTTPS-эндпоинт с доверенным или самоподписанным сертификатом ✓
Нужны сторонние cookie
Проблема: переподключение после обновления страницы не работает.
Решение: включи сторонние cookie в настройках браузера.
Затронутые сценарии:
- Режим приватности браузера
- Safari с включённым «Запретить межсайтовое отслеживание»
- Chrome с включённым «Блокировать сторонние файлы cookie»
Путаница в способах распространения
| Способ | Сценарий использования | Интеграция агента | Нужен ли BYOP |
|---|---|---|---|
| CDN | Большинство случаев | iframe, размещённый в Zoom | Нет (PIN-код создаётся автоматически) |
| npm | Собственный интерфейс агента, полный контроль | Собственная интеграция через npm | Да (обязательно) |
Главное: если нужна интеграция через npm, необходимо использовать режим BYOP (Bring Your Own PIN).
Работа с кросс-доменными iframe
Проблема: Cobrowse не работает в кросс-доменных iframe.
Решение: вставь фрагмент SDK в кросс-доменные iframe:
<script>
const ZOOM_SDK_KEY = "YOUR_SDK_KEY_HERE";
(function(r,a,b,f,c,d){r[f]=r[f]||{init:function(){r.ZoomCobrowseSDKInitArgs=arguments}};
var fragment=a.createDocumentFragment();function loadJs(url) {c=a.createElement(b);d=a.getElementsByTagName(b)[0];c.async=false;c.src=url;fragment.appendChild(c);};
loadJs('https://us01-zcb.zoom.us/static/resource/sdk/${ZOOM_SDK_KEY}/js');d.parentNode.insertBefore(fragment,d);})(window,document,'script','ZoomCobrowseSDK');
</script>
Iframe того же домена: дополнительная настройка не нужна.
Известные ограничения
Ограничения синхронизации
Не синхронизируются:
- Элементы HTML5 Canvas
- Содержимое WebGL
- Элементы audio и video
- Shadow DOM
- PDF, отрисованные через Canvas
- Веб-компоненты
Синхронизируются частично:
- Выпадающие списки (только выбранное значение)
- Выбор даты (только выбранное значение)
- Выбор цвета (только выбранное значение)
Ограничения отрисовки
- Изображения высокого разрешения могут сжиматься
- Разные размеры экранов могут давать различия в CSS media query
- Кросс-доменные изображения могут не отображаться (ограничения CORS)
- Кросс-доменные шрифты могут не отображаться (ограничения CORS)
Ограничения маскирования
Поддерживается:
- Текстовые узлы ✓
- Поля форм ✓
- Элементы select ✓
Не поддерживается:
- Элементы
<img>✗ - Ссылки ✗
Полная библиотека документации
В этот скилл входят подробные руководства по категориям:
Основные понятия
- [Схема двух ролей](concepts/two-roles-pattern.md) — архитектура клиента и агента
- [Жизненный цикл сессии](concepts/session-lifecycle.md) — полный путь от начала до конца
- [Аутентификация JWT](concepts/jwt-authentication.md) — структура токена и подпись
- [Способы распространения](concepts/distribution-methods.md) — CDN и npm (BYOP)
Примеры
- [Интеграция на стороне клиента](examples/customer-integration.md) — полная настройка на стороне клиента
- [Интеграция на стороне агента](examples/agent-integration.md) — настройки агента через iframe и npm
- [Аннотации](examples/annotations.md) — настройка инструментов рисования
- [Маскирование конфиденциальных данных](examples/privacy-masking.md) — шаблоны маскирования полей
- [Удалённая помощь](examples/remote-assist.md) — управление страницей агентом
- [Сохранение сессии между вкладками](examples/multi-tab-persistence.md) — сессии между вкладками
- [Свой PIN-код (BYOP)](examples/byop-custom-pin.md) — собственные PIN-коды
Справочники
- [Справочник по API](references/api-reference.md) — все методы и события SDK
- [Справочник по настройкам](references/settings-reference.md) — все настройки инициализации
- [Коды ошибок](references/error-codes.md) — полный справочник ошибок
- [События сессии](references/session-events.md) — все типы событий
Устранение неполадок
- [Частые проблемы](troubleshooting/common-issues.md) — быстрая диагностика
- [Коды ошибок](troubleshooting/error-codes.md) — справочник кодов ошибок
- [CORS и CSP](troubleshooting/cors-csp.md) — настройка кросс-доменных запросов
- [Совместимость с браузерами](troubleshooting/browser-compatibility.md) — поддержка браузеров
Ресурсы
- Официальная документация: https://developers.zoom.us/docs/cobrowse-sdk/
- Справочник по API: https://marketplacefront.zoom.us/sdk/cobrowse/
- Репозиторий быстрого старта: https://github.com/zoom/CobrowseSDK-Quickstart
- Пример эндпоинта авторизации: https://github.com/zoom/cobrowsesdk-auth-endpoint-sample
- Форум разработчиков: https://devforum.zoom.us/
- Блог разработчиков: https://developers.zoom.us/blog/?category=zoom-cobrowse-sdk
Нужна помощь? Начни с раздела «Сводный указатель» ниже, где собрана вся навигация.
Сводный указатель
_Этот раздел перенесён из SKILL.md._
Полное навигационное руководство по всей документации Cobrowse SDK.
Начало работы (начни здесь!)
Если ты впервые работаешь с Zoom Cobrowse SDK, иди по этому пути обучения:
- [SKILL.md](SKILL.md) — основной обзор и быстрый старт
- [Пятиминутный чек-лист](RUNBOOK.md) — предстартовые проверки на частые сбои
- [Руководство по началу работы](get-started.md) — пошаговая настройка от учётных данных до первой сессии
- [Жизненный цикл сессии](concepts/session-lifecycle.md) — полный сценарий клиента и агента
- [Интеграция на стороне клиента](examples/customer-integration.md) — встраивание SDK на ваш сайт
- [Интеграция на стороне агента](examples/agent-integration.md) — настройка портала агента
Основные понятия
Базовые понятия, которые нужно усвоить:
- [Схема двух ролей](concepts/two-roles-pattern.md) — архитектура клиента (role_type=1) и агента (role_type=2)
- [Жизненный цикл сессии](concepts/session-lifecycle.md) — полный путь: init → start → PIN → подключение → завершение
- [Аутентификация JWT](concepts/jwt-authentication.md) — структура токена, подпись, SDK Key и API Key
- [Способы распространения](concepts/distribution-methods.md) — CDN и npm (режим BYOP)
Примеры и шаблоны
Готовые рабочие примеры для типовых сценариев:
Управление сессией
- [Интеграция на стороне клиента](examples/customer-integration.md) — полная реализация на стороне клиента (CDN и npm)
- [Интеграция на стороне агента](examples/agent-integration.md) — шаблоны настройки агента через iframe и npm
- [События сессии](examples/session-events.md) — обработка всех событий жизненного цикла сессии
- [Автоматическое переподключение](examples/auto-reconnection.md) — обновление страницы и восстановление сессии
Возможности
- [Инструменты аннотирования](examples/annotations.md) — включение рисования, выделения, исчезающего пера
- [Маскирование конфиденциальных данных](examples/privacy-masking.md) — маскирование чувствительных полей по CSS-селекторам
- [Удалённая помощь](examples/remote-assist.md) — агент может прокручивать страницу клиента
- [Сохранение сессии между вкладками](examples/multi-tab-persistence.md) — сессия продолжается между вкладками браузера
- [Свой PIN-код (BYOP)](examples/byop-custom-pin.md) — Bring Your Own PIN при интеграции через npm
Справочники
Полные справочники по API и конфигурации:
Справочник по SDK
- [Справочник по API](references/api-reference.md) — все методы и интерфейсы SDK
- ZoomCobrowseSDK.init()
- session.start()
- session.join()
- session.end()
- session.on()
- session.getSessionInfo()
- [Справочник по настройкам](references/settings-reference.md) — все настройки инициализации
- allowAgentAnnotation
- allowCustomerAnnotation
- piiMask
- remoteAssist
- multiTabSessionPersistence
- [Справочник по событиям сессии](references/session-events.md) — все типы событий
- pincode_updated
- session_started
- session_ended
- agent_joined
- agent_left
- session_error
- session_reconnecting
- remote_assist_started
- remote_assist_stopped
Справочник по ошибкам
- [Коды ошибок](references/error-codes.md) — полный справочник кодов ошибок
- 1001-1017: ошибки сессии
- 2001: ошибки токена
- 9999: ошибки сервиса
Официальная документация
- [Начало работы](references/get-started.md) — официальная документация по началу работы (собрана с сайта)
- [Возможности](references/features.md) — официальная документация по возможностям (собрана с сайта)
- [Авторизация](references/authorization.md) — официальная документация по авторизации JWT (собрана с сайта)
- [Документация по API](references/api.md) — справочник по API (собран с сайта)
Устранение неполадок
Быстрая диагностика и решение частых проблем:
- [Частые проблемы](troubleshooting/common-issues.md) — быстрые исправления частых неполадок
- SDK не загружается
- Не создаётся токен
- Агент не может подключиться
- Поля не маскируются
- Сессия не переподключается после обновления страницы
- [Коды ошибок](troubleshooting/error-codes.md) — поиск по коду ошибки и решения
- Сбои начала и подключения к сессии (1001, 1011, 1016)
- Ошибки лимитов сессии (1002, 1004, 1012, 1013, 1015)
- Ошибки PIN-кода (1006, 1008, 1009, 1010)
- Ошибки токена (2001)
- [CORS и CSP](troubleshooting/cors-csp.md) — настройка кросс-доменных запросов и Content Security Policy
- Заголовки Access-Control-Allow-Origin
- Заголовки Content-Security-Policy
- Работа с кросс-доменными iframe
- Работа с iframe того же домена
- [Совместимость с браузерами](troubleshooting/browser-compatibility.md) — требования к браузерам и ограничения
- Поддерживаемые браузеры (Chrome 80+, Firefox 78+, Safari 14+, Edge 80+)
- Internet Explorer не поддерживается
- Ограничения режима приватности
- Требования к сторонним cookie
По сценарию использования
Найди документацию по тому, что хочешь сделать:
Я хочу...
Настроить cobrowse впервые:
- [Руководство по началу работы](get-started.md)
- [Аутентификация JWT](concepts/jwt-authentication.md)
- [Интеграция на стороне клиента](examples/customer-integration.md)
- [Интеграция на стороне агента](examples/agent-integration.md)
Добавить инструменты аннотирования:
- [Пример инструментов аннотирования](examples/annotations.md)
- [Справочник по настройкам — allowAgentAnnotation](references/settings-reference.md#allowa gentannotation)
- [Справочник по настройкам — allowCustomerAnnotation](references/settings-reference.md#allowcustomerannotation)
Скрыть чувствительные данные от агентов:
- [Пример маскирования конфиденциальных данных](examples/privacy-masking.md)
- [Справочник по настройкам — piiMask](references/settings-reference.md#piimask)
Дать агентам управлять страницей клиента:
- [Пример удалённой помощи](examples/remote-assist.md)
- [Справочник по настройкам — remoteAssist](references/settings-reference.md#remoteassist)
Использовать собственные PIN-коды:
- [Пример со своим PIN-кодом (BYOP)](examples/byop-custom-pin.md)
- [Аутентификация JWT — enable_byop](concepts/jwt-authentication.md#enable-byop)
Обработать обновление страницы:
- [Пример автоматического переподключения](examples/auto-reconnection.md)
- [Жизненный цикл сессии — восстановление](concepts/session-lifecycle.md#session-recovery)
Интегрироваться через npm (не через CDN):
- [Пример со своим PIN-кодом (BYOP)](examples/byop-custom-pin.md)
- [Способы распространения](concepts/distribution-methods.md#npm-integration)
Отладить проблемы с подключением к сессии:
- [Частые проблемы](troubleshooting/common-issues.md)
- [Коды ошибок](troubleshooting/error-codes.md)
- [События сессии — session_error](examples/session-events.md#session-error)
Настроить заголовки CORS и CSP:
- [Руководство по CORS и CSP](troubleshooting/cors-csp.md)
- [Совместимость с браузерами](troubleshooting/browser-compatibility.md)
По коду ошибки
Быстрый поиск решений по коду ошибки:
Ошибки сессии
- 1001 (SESSION_START_FAILED) → [Коды ошибок](troubleshooting/error-codes.md#1001-session-start-failed)
- 1002 (SESSION_CONNECTING_IN_PROGRESS) → [Коды ошибок](troubleshooting/error-codes.md#1002-session-connecting-in-progress)
- 1004 (SESSION_COUNT_LIMIT) → [Коды ошибок](troubleshooting/error-codes.md#1004-session-count-limit)
- 1011 (SESSION_JOIN_FAILED) → [Коды ошибок](troubleshooting/error-codes.md#1011-session-join-failed)
- 1012 (SESSION_CUSTOMER_COUNT_LIMIT) → [Коды ошибок](troubleshooting/error-codes.md#1012-session-customer-count-limit)
- 1013 (SESSION_AGENT_COUNT_LIMIT) → [Коды ошибок](troubleshooting/error-codes.md#1013-session-agent-count-limit)
- 1015 (SESSION_DUPLICATE_USER) → [Коды ошибок](troubleshooting/error-codes.md#1015-session-duplicate-user)
- 1016 (NETWORK_ERROR) → [Коды ошибок](troubleshooting/error-codes.md#1016-network-error)
- 1017 (SESSION_CANCELING_IN_PROGRESS) → [Коды ошибок](troubleshooting/error-codes.md#1017-session-canceling-in-progress)
Ошибки PIN-кода
- 1006 (SESSION_JOIN_PIN_NOT_FOUND) → [Коды ошибок](troubleshooting/error-codes.md#1006-session-join-pin-not-found)
- 1008 (SESSION_PIN_INVALID_FORMAT) → [Коды ошибок](troubleshooting/error-codes.md#1008-session-pin-invalid-format)
- 1009 (SESSION_START_PIN_REQUIRED) → [Коды ошибок](troubleshooting/error-codes.md#1009-session-start-pin-required)
- 1010 (SESSION_START_PIN_CONFLICT) → [Коды ошибок](troubleshooting/error-codes.md#1010-session-start-pin-conflict)
Ошибки авторизации
- 2001 (TOKEN_INVALID) → [Коды ошибок](troubleshooting/error-codes.md#2001-token-invalid)
Ошибки сервиса
- 9999 (UNDEFINED) → [Коды ошибок](troubleshooting/error-codes.md#9999-undefined)
Официальные ресурсы
Внешняя документация и примеры:
- Официальная документация: https://developers.zoom.us/docs/cobrowse-sdk/
- Справочник по API: https://marketplacefront.zoom.us/sdk/cobrowse/
- Репозиторий быстрого старта: https://github.com/zoom/CobrowseSDK-Quickstart
- Пример эндпоинта авторизации: https://github.com/zoom/cobrowsesdk-auth-endpoint-sample
- Форум разработчиков: https://devforum.zoom.us/
- Блог разработчиков: https://developers.zoom.us/blog/?category=zoom-cobrowse-sdk
Структура документации
cobrowse-sdk/
├── SKILL.md # Главная точка входа скилла
├── SKILL.md # Этот файл — полная навигация
├── get-started.md # Пошаговое руководство по настройке
│
├── concepts/ # Основные понятия
│ ├── two-roles-pattern.md
│ ├── session-lifecycle.md
│ ├── jwt-authentication.md
│ └── distribution-methods.md
│
├── examples/ # Рабочие примеры
│ ├── customer-integration.md
│ ├── agent-integration.md
│ ├── annotations.md
│ ├── privacy-masking.md
│ ├── remote-assist.md
│ ├── multi-tab-persistence.md
│ ├── byop-custom-pin.md
│ ├── session-events.md
│ └── auto-reconnection.md
│
├── references/ # Справочники по API и конфигурации
│ ├── api-reference.md # Методы SDK
│ ├── settings-reference.md # Настройки инициализации
│ ├── session-events.md # Типы событий
│ ├── error-codes.md # Справочник ошибок
│ ├── get-started.md # Официальная документация (собрана с сайта)
│ ├── features.md # Официальная документация (собрана с сайта)
│ ├── authorization.md # Официальная документация (собрана с сайта)
│ └── api.md # Документация по API (собрана с сайта)
│
└── troubleshooting/ # Решение проблем
├── common-issues.md
├── error-codes.md
├── cors-csp.md
└── browser-compatibility.md
Советы по поиску
Поиск по ключевому слову:
- «annotation» → [Инструменты аннотирования](examples/annotations.md)
- «mask» или «privacy» → [Маскирование конфиденциальных данных](examples/privacy-masking.md)
- «PIN» или «custom PIN» → [Свой PIN-код (BYOP)](examples/byop-custom-pin.md)
- «JWT» или «token» → [Аутентификация JWT](concepts/jwt-authentication.md)
- «error» → [Коды ошибок](troubleshooting/error-codes.md)
- «CORS» или «CSP» → [CORS и CSP](troubleshooting/cors-csp.md)
- «iframe» → [Интеграция на стороне агента](examples/agent-integration.md)
- «npm» → [Способы распространения](concepts/distribution-methods.md), [BYOP](examples/byop-custom-pin.md)
- «refresh» или «reconnect» → [Автоматическое переподключение](examples/auto-reconnection.md)
- «agent» → [Интеграция на стороне агента](examples/agent-integration.md), [Схема двух ролей](concepts/two-roles-pattern.md)
- «customer» → [Интеграция на стороне клиента](examples/customer-integration.md), [Схема двух ролей](concepts/two-roles-pattern.md)
Не нашёл нужное? Загляни в официальную документацию или спроси на форуме разработчиков.
Переменные окружения
- Стандартизированные ключи
.envи то, где взять каждое значение, см. в [references/environment-variables.md](references/environment-variables.md).
Перевод: iiuniversitet. Оригинал: https://github.com/anthropics/knowledge-work-plugins/tree/main/partner-built/zoom-plugin/skills/cobrowse-sdk, лицензия MIT. Изменения: перевод на русский язык.
Оригинал на английском
---
name: zoom-cobrowse-sdk
description: "Reference skill for Zoom Cobrowse SDK. Use after routing to a collaborative-support workflow when implementing browser co-browsing, annotation tools, privacy masking, remote assist, or PIN-based session sharing."
user-invocable: false
triggers:
- "cobrowse"
- "co-browse"
- "collaborative browsing"
- "agent assist"
- "customer support screen share"
- "zoom cobrowse"
---
# Zoom Cobrowse SDK - Web Development
Background reference for collaborative browsing on the web with Zoom Cobrowse SDK. Use this after the support workflow is clear and you need implementation detail.
**Official Documentation**: https://developers.zoom.us/docs/cobrowse-sdk/
**API Reference**: https://marketplacefront.zoom.us/sdk/cobrowse/
**Quickstart Repository**: https://github.com/zoom/CobrowseSDK-Quickstart
**Auth Endpoint Sample**: https://github.com/zoom/cobrowsesdk-auth-endpoint-sample
## Quick Links
**New to Cobrowse SDK? Follow this path:**
1. **[Get Started Guide](get-started.md)** - Complete setup from credentials to first session
2. **[Session Lifecycle](concepts/session-lifecycle.md)** - Understanding customer and agent flows
3. **[JWT Authentication](concepts/jwt-authentication.md)** - Token generation and security
4. **[Customer Integration](examples/customer-integration.md)** - Integrate SDK into your website
5. **[Agent Integration](examples/agent-integration.md)** - Set up agent portal (iframe or npm)
**Core Concepts:**
- **[Two Roles Pattern](concepts/two-roles-pattern.md)** - Customer vs Agent architecture
- **[Session Lifecycle](concepts/session-lifecycle.md)** - PIN generation, connection, reconnection
- **[JWT Authentication](concepts/jwt-authentication.md)** - SDK Key vs API Key, role_type, claims
- **[Distribution Methods](concepts/distribution-methods.md)** - CDN vs npm (BYOP)
**Features:**
- **[Annotation Tools](examples/annotations.md)** - Drawing, highlighting, pointer tools
- **[Privacy Masking](examples/privacy-masking.md)** - Hide sensitive fields from agents
- **[Remote Assist](examples/remote-assist.md)** - Agent can scroll customer's page
- **[Multi-Tab Persistence](examples/multi-tab-persistence.md)** - Session continues across tabs
- **[BYOP Mode](examples/byop-custom-pin.md)** - Bring Your Own PIN with npm integration
**Troubleshooting:**
- **[Common Issues](troubleshooting/common-issues.md)** - Quick diagnostics and solutions
- **[Error Codes](troubleshooting/error-codes.md)** - Complete error reference
- **[CORS and CSP](troubleshooting/cors-csp.md)** - Cross-origin and security policy configuration
- **[Browser Compatibility](troubleshooting/browser-compatibility.md)** - Supported browsers and limitations
- **[5-Minute Runbook](RUNBOOK.md)** - Fast preflight checks before deep debugging
**Reference:**
- **[API Reference](references/api-reference.md)** - Complete SDK methods and events
- **[Settings Reference](references/settings-reference.md)** - All initialization settings
- **Integrated Index** - see the section below in this file
## SDK Overview
The Zoom Cobrowse SDK is a JavaScript library that provides:
- **Real-Time Co-Browsing**: Agent sees customer's browser activity live
- **PIN-Based Sessions**: Secure 6-digit PIN for customer-to-agent connection
- **Annotation Tools**: Drawing, highlighting, vanishing pen, rectangle, color picker
- **Privacy Masking**: CSS selector-based masking of sensitive form fields
- **Remote Assist**: Agent can scroll customer's page (with consent)
- **Multi-Tab Persistence**: Session continues when customer opens new tabs
- **Auto-Reconnection**: Session recovers from page refresh (2-minute window)
- **Session Events**: Real-time events for session state changes
- **HTTPS Required**: Secure connections (HTTP only works on loopback/local development hosts)
- **No Plugins**: Pure JavaScript, no browser extensions needed
## Two Roles Architecture
Cobrowse has **two distinct roles**, each with different integration patterns:
| Role | role_type | Integration | JWT Required | Purpose |
|------|-----------|-------------|--------------|---------|
| **Customer** | 1 | Website integration (CDN or npm) | Yes | User who shares their browser session |
| **Agent** | 2 | Iframe (CDN) or npm (BYOP only) | Yes | Support staff who views/assists customer |
**Key Insight**: Customer and agent use **different integration methods** but the same JWT authentication pattern.
## Read This First (Critical)
For customer/agent demos, treat the PIN from customer SDK event `pincode_updated` as the only user-facing PIN.
- Show one clearly labeled value in UI (for example, **Support PIN**).
- Use that same PIN for agent join.
- Do not expose provisional/debug PINs from backend pre-start records to users.
If these rules are ignored, agent desk often fails with `Pincode is not found` / code `30308`.
### Typical Production Flow (Most Common)
This is the flow most teams implement first, and what users usually expect in demos:
1. **Customer starts session first** (`role_type=1`)
- Backend creates/records session
- Backend returns customer JWT
- Customer SDK starts and receives a PIN
2. **Agent joins second** (`role_type=2`)
- Agent enters customer PIN
- Backend validates PIN and session state
- Backend returns agent JWT
- Agent opens Zoom-hosted desk iframe (or custom npm agent UI in BYOP)
If a demo only has one generic "session" user, it is incomplete for real cobrowse operations.
## Prerequisites
### Platform Requirements
- **Supported Browsers**:
- Chrome 80+ ✓
- Firefox 78+ ✓
- Safari 14+ ✓
- Edge 80+ ✓
- Internet Explorer ✗ (not supported)
- **Network Requirements**:
- HTTPS required (HTTP works on loopback/local development hosts only)
- Allow cross-origin requests to `*.zoom.us`
- CSP headers must allow Zoom domains (see [CORS and CSP guide](troubleshooting/cors-csp.md))
- **Third-Party Cookies**:
- Must enable third-party cookies for refresh reconnection
- Privacy mode may limit certain features
### Zoom Account Requirements
1. **Zoom Workplace Account** with SDK Universal Credit
2. **Video SDK App** created in Zoom Marketplace
3. **Cobrowse SDK Credentials** from the app's Cobrowse tab
**Note**: Cobrowse SDK is a **feature of Video SDK** (not a separate product).
### Credentials Overview
You'll receive **4 credentials** from Zoom Marketplace → Video SDK App → Cobrowse tab:
| Credential | Type | Used For | Exposure Safe? |
|------------|------|----------|----------------|
| **SDK Key** | Public | CDN URL, JWT `app_key` claim | ✓ Yes (client-side) |
| **SDK Secret** | Private | Sign JWTs | ✗ No (server-side only) |
| **API Key** | Private | REST API calls (optional) | ✗ No (server-side only) |
| **API Secret** | Private | REST API calls (optional) | ✗ No (server-side only) |
**Critical**: SDK Key is **public** (embedded in CDN URL), but SDK Secret must **never** be exposed client-side.
## Quick Start
### Step 1: Get SDK Credentials
1. Go to [Zoom Marketplace](https://marketplace.zoom.us/)
2. Open your **Video SDK App** (or create one)
3. Navigate to the **Cobrowse** tab
4. Copy your credentials:
- SDK Key
- SDK Secret
- API Key (optional)
- API Secret (optional)
### Step 2: Set Up Token Server
Deploy a server-side endpoint to generate JWTs. Use the official sample:
```bash
git clone https://github.com/zoom/cobrowsesdk-auth-endpoint-sample.git
cd cobrowsesdk-auth-endpoint-sample
npm install
# Create .env file
cat > .env << EOF
ZOOM_SDK_KEY=your_sdk_key_here
ZOOM_SDK_SECRET=your_sdk_secret_here
PORT=4000
EOF
npm start
```
**Token endpoint:**
```javascript
// POST https://YOUR_TOKEN_SERVICE_BASE_URL
{
"role": 1, // 1 = customer, 2 = agent
"userId": "user123",
"userName": "John Doe"
}
// Response
{
"token": "eyJhbGciOiJIUzI1NiIs..."
}
```
### Step 3: Customer Side Integration (CDN)
```html
<!DOCTYPE html>
<html>
<head>
<title>Customer - Cobrowse Demo</title>
<script type="module">
const ZOOM_SDK_KEY = 'YOUR_SDK_KEY';
// Load SDK from CDN
(function(r, a, b, f, c, d) {
r[f] = r[f] || { init: function() { r.ZoomCobrowseSDKInitArgs = arguments }};
var fragment = a.createDocumentFragment();
function loadJs(url) {
c = a.createElement(b);
d = a.getElementsByTagName(b)[0];
c["async"] = false;
c.src = url;
fragment.appendChild(c);
}
loadJs(`https://us01-zcb.zoom.us/static/resource/sdk/${ZOOM_SDK_KEY}/js/2.13.2`);
d.parentNode.insertBefore(fragment, d);
})(window, document, "script", "ZoomCobrowseSDK");
</script>
</head>
<body>
<h1>Customer Support</h1>
<button id="cobrowse-btn" disabled>Loading...</button>
<!-- Sensitive fields - will be masked from agent -->
<label>SSN: <input type="text" class="pii-mask" placeholder="XXX-XX-XXXX"></label>
<label>Credit Card: <input type="text" class="pii-mask" placeholder="XXXX-XXXX-XXXX-XXXX"></label>
<script type="module">
let sessionRef = null;
const settings = {
allowAgentAnnotation: true,
allowCustomerAnnotation: true,
piiMask: {
maskCssSelectors: ".pii-mask",
maskType: "custom_input"
}
};
ZoomCobrowseSDK.init(settings, function({ success, session, error }) {
if (success) {
sessionRef = session;
// Listen for PIN code
session.on("pincode_updated", (payload) => {
console.log("PIN Code:", payload.pincode);
// IMPORTANT: this is the PIN agent should use
alert(`Share this PIN with agent: ${payload.pincode}`);
});
// Listen for session events
session.on("session_started", () => console.log("Session started"));
session.on("agent_joined", () => console.log("Agent joined"));
session.on("agent_left", () => console.log("Agent left"));
session.on("session_ended", () => console.log("Session ended"));
document.getElementById("cobrowse-btn").disabled = false;
document.getElementById("cobrowse-btn").innerText = "Start Cobrowse Session";
} else {
console.error("SDK init failed:", error);
}
});
document.getElementById("cobrowse-btn").addEventListener("click", async () => {
// Fetch JWT from your server
const response = await fetch("https://YOUR_TOKEN_SERVICE_BASE_URL", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
role: 1,
userId: "customer_" + Date.now(),
userName: "Customer"
})
});
const { token } = await response.json();
// Start cobrowse session
sessionRef.start({ sdkToken: token });
});
</script>
</body>
</html>
```
### Step 4: Agent Side Integration (Iframe)
```html
<!DOCTYPE html>
<html>
<head>
<title>Agent Portal</title>
</head>
<body>
<h1>Agent Portal</h1>
<iframe
id="agent-iframe"
width="1024"
height="768"
allow="autoplay *; camera *; microphone *; display-capture *; geolocation *;"
></iframe>
<script>
async function connectAgent() {
// Fetch JWT from your server
const response = await fetch("https://YOUR_TOKEN_SERVICE_BASE_URL", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
role: 2,
userId: "agent_" + Date.now(),
userName: "Support Agent"
})
});
const { token } = await response.json();
// Load Zoom agent portal
const iframe = document.getElementById("agent-iframe");
iframe.src = `https://us01-zcb.zoom.us/sdkapi/zcb/frame-templates/desk?access_token=${token}`;
}
connectAgent();
</script>
</body>
</html>
```
### Step 5: Test the Integration
1. Open **two separate browsers** (or incognito + normal)
2. **Customer browser**: Open customer page, click "Start Cobrowse Session"
3. **Customer browser**: Note the 6-digit PIN displayed
4. **Agent browser**: Open agent page, enter the PIN code
5. **Both browsers**: Session connects, agent can see customer's page
6. **Test features**: Annotations, data masking, remote assist
## Key Features
### 1. Annotation Tools
Both customer and agent can draw on the shared screen:
```javascript
const settings = {
allowAgentAnnotation: true, // Agent can draw
allowCustomerAnnotation: true // Customer can draw
};
```
**Available tools**:
- Pen (persistent)
- Vanishing pen (disappears after 4 seconds)
- Rectangle
- Color picker
- Eraser
- Undo/Redo
### 2. Privacy Masking
Hide sensitive fields from agents using CSS selectors:
```javascript
const settings = {
piiMask: {
maskType: "custom_input", // Mask specific fields
maskCssSelectors: ".pii-mask, #ssn", // CSS selectors
maskHTMLAttributes: "data-sensitive=true" // HTML attributes
}
};
```
**Supported masking**:
- Text nodes ✓
- Form inputs ✓
- Select elements ✓
- Images ✗ (not supported)
- Links ✗ (not supported)
### 3. Remote Assist
Agent can scroll the customer's page:
```javascript
const settings = {
remoteAssist: {
enable: true,
enableCustomerConsent: true, // Customer must approve
remoteAssistTypes: ['scroll_page'], // Only scroll supported
requireStopConfirmation: false // Confirmation when stopping
}
};
```
### 4. Multi-Tab Session Persistence
Session continues when customer opens new tabs:
```javascript
const settings = {
multiTabSessionPersistence: {
enable: true,
stateCookieKey: '$$ZCB_SESSION$$' // Cookie key (base64 encoded)
}
};
```
## Session Lifecycle
### Customer Flow
1. **Load SDK** → CDN script loads `ZoomCobrowseSDK`
2. **Initialize** → `ZoomCobrowseSDK.init(settings, callback)`
3. **Fetch JWT** → Request token from your server (role_type=1)
4. **Start Session** → `session.start({ sdkToken })`
5. **PIN Generated** → `pincode_updated` event fires
6. **Share PIN** → Customer gives 6-digit PIN to agent
7. **Agent Joins** → `agent_joined` event fires
8. **Session Active** → Real-time synchronization begins
9. **End Session** → `session.end()` or agent leaves
### Agent Flow
1. **Fetch JWT** → Request token from your server (role_type=2)
2. **Load Iframe** → Point to Zoom agent portal with token
3. **Enter PIN** → Agent inputs customer's 6-digit PIN
4. **Connect** → `session_joined` event fires
5. **View Session** → Agent sees customer's browser
6. **Use Tools** → Annotations, remote assist, zoom
7. **Leave Session** → Click "Leave Cobrowse" button
### Session Recovery (Auto-Reconnect)
When customer refreshes the page:
```javascript
ZoomCobrowseSDK.init(settings, function({ success, session, error }) {
if (success) {
const sessionInfo = session.getSessionInfo();
// Check if session is recoverable
if (sessionInfo.sessionStatus === 'session_recoverable') {
session.join(); // Auto-rejoin previous session
} else {
// Start new session
session.start({ sdkToken });
}
}
});
```
**Recovery window**: 2 minutes. After 2 minutes, session ends.
## Critical Gotchas and Best Practices
### ⚠️ CRITICAL: SDK Secret Must Stay Server-Side
**Problem**: Developers often accidentally embed SDK Secret in frontend code.
**Solution**:
- ✓ **SDK Key** → Safe to expose (embedded in CDN URL)
- ✗ **SDK Secret** → Never expose (use for JWT signing server-side)
```javascript
// ❌ WRONG - Secret exposed in frontend
const jwt = signJWT(payload, 'YOUR_SDK_SECRET'); // Security risk!
// ✅ CORRECT - Secret stays on server
const response = await fetch('/api/token', {
method: 'POST',
body: JSON.stringify({ role: 1, userId, userName })
});
const { token } = await response.json();
```
### SDK Key vs API Key (Different Purposes!)
| Credential | Used For | JWT Claim |
|------------|----------|-----------|
| **SDK Key** | CDN URL, JWT `app_key` | `app_key: "SDK_KEY"` |
| **API Key** | REST API calls (optional) | Not used in JWT |
**Common mistake**: Using API Key instead of SDK Key in JWT `app_key` claim.
### Session Limits
| Limit | Value | What Happens |
|-------|-------|--------------|
| Customers per session | 1 | Error 1012: `SESSION_CUSTOMER_COUNT_LIMIT` |
| Agents per session | 5 | Error 1013: `SESSION_AGENT_COUNT_LIMIT` |
| Active sessions per browser | 1 | Error 1004: `SESSION_COUNT_LIMIT` |
| PIN code length | 10 chars max | Error 1008: `SESSION_PIN_INVALID_FORMAT` |
### Session Timeout Behavior
| Event | Timeout | What Happens |
|-------|---------|--------------|
| Agent waiting for customer | 3 minutes | Session ends automatically |
| Page refresh reconnection | 2 minutes | Session ends if not reconnected |
| Reconnection attempts | 2 times max | Session ends after 2 failed attempts |
### HTTPS Requirement
**Problem**: SDK doesn't load on HTTP sites.
**Solution**:
- Production: Use HTTPS ✓
- Development: Use a loopback host for local HTTP testing ✓
- Development: Use a local HTTPS endpoint with a trusted/self-signed cert if required ✓
### Third-Party Cookies Required
**Problem**: Refresh reconnection doesn't work.
**Solution**: Enable third-party cookies in browser settings.
**Affected scenarios**:
- Browser privacy mode
- Safari with "Prevent cross-site tracking" enabled
- Chrome with "Block third-party cookies" enabled
### Distribution Method Confusion
| Method | Use Case | Agent Integration | BYOP Required |
|--------|----------|-------------------|---------------|
| **CDN** | Most use cases | Zoom-hosted iframe | No (auto PIN) |
| **npm** | Custom agent UI, full control | Custom npm integration | Yes (required) |
**Key Insight**: If you want **npm** integration, you **must** use BYOP (Bring Your Own PIN) mode.
### Cross-Origin Iframe Handling
**Problem**: Cobrowse doesn't work in cross-origin iframes.
**Solution**: Inject SDK snippet into cross-origin iframes:
```html
<script>
const ZOOM_SDK_KEY = "YOUR_SDK_KEY_HERE";
(function(r,a,b,f,c,d){r[f]=r[f]||{init:function(){r.ZoomCobrowseSDKInitArgs=arguments}};
var fragment=a.createDocumentFragment();function loadJs(url) {c=a.createElement(b);d=a.getElementsByTagName(b)[0];c.async=false;c.src=url;fragment.appendChild(c);};
loadJs('https://us01-zcb.zoom.us/static/resource/sdk/${ZOOM_SDK_KEY}/js');d.parentNode.insertBefore(fragment,d);})(window,document,'script','ZoomCobrowseSDK');
</script>
```
**Same-origin iframes**: No extra setup needed.
## Known Limitations
### Synchronization Limits
**Not synchronized**:
- HTML5 Canvas elements
- WebGL content
- Audio and Video elements
- Shadow DOM
- PDF rendered with Canvas
- Web Components
**Partially synchronized**:
- Drop-down boxes (only selected result)
- Date pickers (only selected result)
- Color pickers (only selected result)
### Rendering Limits
- High-resolution images may be compressed
- Different screen sizes may cause CSS media query differences
- Cross-origin images may not render (CORS restrictions)
- Cross-origin fonts may not render (CORS restrictions)
### Masking Limits
**Supported**:
- Text nodes ✓
- Form inputs ✓
- Select elements ✓
**Not supported**:
- `<img>` elements ✗
- Links ✗
## Complete Documentation Library
This skill includes comprehensive guides organized by category:
### Core Concepts
- **[Two Roles Pattern](concepts/two-roles-pattern.md)** - Customer vs Agent architecture
- **[Session Lifecycle](concepts/session-lifecycle.md)** - Complete flow from start to end
- **[JWT Authentication](concepts/jwt-authentication.md)** - Token structure and signing
- **[Distribution Methods](concepts/distribution-methods.md)** - CDN vs npm (BYOP)
### Examples
- **[Customer Integration](examples/customer-integration.md)** - Complete customer-side setup
- **[Agent Integration](examples/agent-integration.md)** - Iframe and npm agent setups
- **[Annotations](examples/annotations.md)** - Drawing tools configuration
- **[Privacy Masking](examples/privacy-masking.md)** - Field masking patterns
- **[Remote Assist](examples/remote-assist.md)** - Agent page control
- **[Multi-Tab Persistence](examples/multi-tab-persistence.md)** - Cross-tab sessions
- **[BYOP Custom PIN](examples/byop-custom-pin.md)** - Custom PIN codes
### References
- **[API Reference](references/api-reference.md)** - Complete SDK methods and events
- **[Settings Reference](references/settings-reference.md)** - All initialization settings
- **[Error Codes](references/error-codes.md)** - Complete error reference
- **[Session Events](references/session-events.md)** - All event types
### Troubleshooting
- **[Common Issues](troubleshooting/common-issues.md)** - Quick diagnostics
- **[Error Codes](troubleshooting/error-codes.md)** - Error code reference
- **[CORS and CSP](troubleshooting/cors-csp.md)** - Cross-origin configuration
- **[Browser Compatibility](troubleshooting/browser-compatibility.md)** - Browser support
## Resources
- **Official Docs**: https://developers.zoom.us/docs/cobrowse-sdk/
- **API Reference**: https://marketplacefront.zoom.us/sdk/cobrowse/
- **Quickstart Repo**: https://github.com/zoom/CobrowseSDK-Quickstart
- **Auth Endpoint Sample**: https://github.com/zoom/cobrowsesdk-auth-endpoint-sample
- **Dev Forum**: https://devforum.zoom.us/
- **Developer Blog**: https://developers.zoom.us/blog/?category=zoom-cobrowse-sdk
---
**Need help?** Start with Integrated Index section below for complete navigation.
---
## Integrated Index
_This section was migrated from `SKILL.md`._
**Complete navigation guide for all Cobrowse SDK documentation.**
## Getting Started (Start Here!)
If you're new to Zoom Cobrowse SDK, follow this learning path:
1. **[SKILL.md](SKILL.md)** - Main overview and quick start
2. **[5-Minute Runbook](RUNBOOK.md)** - Preflight checks for common failures
3. **[Get Started Guide](get-started.md)** - Step-by-step setup from credentials to first session
4. **[Session Lifecycle](concepts/session-lifecycle.md)** - Understand the complete customer and agent flow
5. **[Customer Integration](examples/customer-integration.md)** - Integrate SDK into your website
6. **[Agent Integration](examples/agent-integration.md)** - Set up agent portal
## Core Concepts
Foundational concepts you need to understand:
- **[Two Roles Pattern](concepts/two-roles-pattern.md)** - Customer (role_type=1) vs Agent (role_type=2) architecture
- **[Session Lifecycle](concepts/session-lifecycle.md)** - Complete flow: init → start → PIN → connect → end
- **[JWT Authentication](concepts/jwt-authentication.md)** - Token structure, signing, SDK Key vs API Key
- **[Distribution Methods](concepts/distribution-methods.md)** - CDN vs npm (BYOP mode)
## Examples and Patterns
Complete working examples for common scenarios:
### Session Management
- **[Customer Integration](examples/customer-integration.md)** - Complete customer-side implementation (CDN and npm)
- **[Agent Integration](examples/agent-integration.md)** - Iframe and npm agent setup patterns
- **[Session Events](examples/session-events.md)** - Handle all session lifecycle events
- **[Auto-Reconnection](examples/auto-reconnection.md)** - Page refresh and session recovery
### Features
- **[Annotation Tools](examples/annotations.md)** - Enable drawing, highlighting, vanishing pen
- **[Privacy Masking](examples/privacy-masking.md)** - Mask sensitive fields with CSS selectors
- **[Remote Assist](examples/remote-assist.md)** - Agent can scroll customer's page
- **[Multi-Tab Persistence](examples/multi-tab-persistence.md)** - Session continues across browser tabs
- **[BYOP Custom PIN](examples/byop-custom-pin.md)** - Bring Your Own PIN with npm integration
## References
Complete API and configuration references:
### SDK Reference
- **[API Reference](references/api-reference.md)** - All SDK methods and interfaces
- ZoomCobrowseSDK.init()
- session.start()
- session.join()
- session.end()
- session.on()
- session.getSessionInfo()
- **[Settings Reference](references/settings-reference.md)** - All initialization settings
- allowAgentAnnotation
- allowCustomerAnnotation
- piiMask
- remoteAssist
- multiTabSessionPersistence
- **[Session Events Reference](references/session-events.md)** - All event types
- pincode_updated
- session_started
- session_ended
- agent_joined
- agent_left
- session_error
- session_reconnecting
- remote_assist_started
- remote_assist_stopped
### Error Reference
- **[Error Codes](references/error-codes.md)** - Complete error code reference
- 1001-1017: Session errors
- 2001: Token errors
- 9999: Service errors
### Official Documentation
- **[Get Started](references/get-started.md)** - Official get started documentation (crawled)
- **[Features](references/features.md)** - Official features documentation (crawled)
- **[Authorization](references/authorization.md)** - Official JWT authorization docs (crawled)
- **[API Documentation](references/api.md)** - Crawled API reference docs
## Troubleshooting
Quick diagnostics and common issue resolution:
- **[Common Issues](troubleshooting/common-issues.md)** - Quick fixes for frequent problems
- SDK not loading
- Token generation fails
- Agent can't connect
- Fields not masked
- Session doesn't reconnect after refresh
- **[Error Codes](troubleshooting/error-codes.md)** - Error code lookup and solutions
- Session start/join failures (1001, 1011, 1016)
- Session limit errors (1002, 1004, 1012, 1013, 1015)
- PIN code errors (1006, 1008, 1009, 1010)
- Token errors (2001)
- **[CORS and CSP](troubleshooting/cors-csp.md)** - Cross-origin and Content Security Policy setup
- Access-Control-Allow-Origin headers
- Content-Security-Policy headers
- Cross-origin iframe handling
- Same-origin iframe handling
- **[Browser Compatibility](troubleshooting/browser-compatibility.md)** - Browser requirements and limitations
- Supported browsers (Chrome 80+, Firefox 78+, Safari 14+, Edge 80+)
- Internet Explorer not supported
- Privacy mode limitations
- Third-party cookie requirements
## By Use Case
Find documentation by what you're trying to do:
### I want to...
**Set up cobrowse for the first time:**
- [Get Started Guide](get-started.md)
- [JWT Authentication](concepts/jwt-authentication.md)
- [Customer Integration](examples/customer-integration.md)
- [Agent Integration](examples/agent-integration.md)
**Add annotation tools:**
- [Annotation Tools Example](examples/annotations.md)
- [Settings Reference - allowAgentAnnotation](references/settings-reference.md#allowa gentannotation)
- [Settings Reference - allowCustomerAnnotation](references/settings-reference.md#allowcustomerannotation)
**Hide sensitive data from agents:**
- [Privacy Masking Example](examples/privacy-masking.md)
- [Settings Reference - piiMask](references/settings-reference.md#piimask)
**Let agents control customer's page:**
- [Remote Assist Example](examples/remote-assist.md)
- [Settings Reference - remoteAssist](references/settings-reference.md#remoteassist)
**Use custom PIN codes:**
- [BYOP Custom PIN Example](examples/byop-custom-pin.md)
- [JWT Authentication - enable_byop](concepts/jwt-authentication.md#enable-byop)
**Handle page refreshes:**
- [Auto-Reconnection Example](examples/auto-reconnection.md)
- [Session Lifecycle - Recovery](concepts/session-lifecycle.md#session-recovery)
**Integrate with npm (not CDN):**
- [BYOP Custom PIN Example](examples/byop-custom-pin.md)
- [Distribution Methods](concepts/distribution-methods.md#npm-integration)
**Debug session connection issues:**
- [Common Issues](troubleshooting/common-issues.md)
- [Error Codes](troubleshooting/error-codes.md)
- [Session Events - session_error](examples/session-events.md#session-error)
**Configure CORS and CSP headers:**
- [CORS and CSP Guide](troubleshooting/cors-csp.md)
- [Browser Compatibility](troubleshooting/browser-compatibility.md)
## By Error Code
Quick lookup for error code solutions:
### Session Errors
- **1001** (SESSION_START_FAILED) → [Error Codes](troubleshooting/error-codes.md#1001-session-start-failed)
- **1002** (SESSION_CONNECTING_IN_PROGRESS) → [Error Codes](troubleshooting/error-codes.md#1002-session-connecting-in-progress)
- **1004** (SESSION_COUNT_LIMIT) → [Error Codes](troubleshooting/error-codes.md#1004-session-count-limit)
- **1011** (SESSION_JOIN_FAILED) → [Error Codes](troubleshooting/error-codes.md#1011-session-join-failed)
- **1012** (SESSION_CUSTOMER_COUNT_LIMIT) → [Error Codes](troubleshooting/error-codes.md#1012-session-customer-count-limit)
- **1013** (SESSION_AGENT_COUNT_LIMIT) → [Error Codes](troubleshooting/error-codes.md#1013-session-agent-count-limit)
- **1015** (SESSION_DUPLICATE_USER) → [Error Codes](troubleshooting/error-codes.md#1015-session-duplicate-user)
- **1016** (NETWORK_ERROR) → [Error Codes](troubleshooting/error-codes.md#1016-network-error)
- **1017** (SESSION_CANCELING_IN_PROGRESS) → [Error Codes](troubleshooting/error-codes.md#1017-session-canceling-in-progress)
### PIN Errors
- **1006** (SESSION_JOIN_PIN_NOT_FOUND) → [Error Codes](troubleshooting/error-codes.md#1006-session-join-pin-not-found)
- **1008** (SESSION_PIN_INVALID_FORMAT) → [Error Codes](troubleshooting/error-codes.md#1008-session-pin-invalid-format)
- **1009** (SESSION_START_PIN_REQUIRED) → [Error Codes](troubleshooting/error-codes.md#1009-session-start-pin-required)
- **1010** (SESSION_START_PIN_CONFLICT) → [Error Codes](troubleshooting/error-codes.md#1010-session-start-pin-conflict)
### Auth Errors
- **2001** (TOKEN_INVALID) → [Error Codes](troubleshooting/error-codes.md#2001-token-invalid)
### Service Errors
- **9999** (UNDEFINED) → [Error Codes](troubleshooting/error-codes.md#9999-undefined)
## Official Resources
External documentation and samples:
- **Official Docs**: https://developers.zoom.us/docs/cobrowse-sdk/
- **API Reference**: https://marketplacefront.zoom.us/sdk/cobrowse/
- **Quickstart Repo**: https://github.com/zoom/CobrowseSDK-Quickstart
- **Auth Endpoint Sample**: https://github.com/zoom/cobrowsesdk-auth-endpoint-sample
- **Dev Forum**: https://devforum.zoom.us/
- **Developer Blog**: https://developers.zoom.us/blog/?category=zoom-cobrowse-sdk
## Documentation Structure
```
cobrowse-sdk/
├── SKILL.md # Main skill entry point
├── SKILL.md # This file - complete navigation
├── get-started.md # Step-by-step setup guide
│
├── concepts/ # Core concepts
│ ├── two-roles-pattern.md
│ ├── session-lifecycle.md
│ ├── jwt-authentication.md
│ └── distribution-methods.md
│
├── examples/ # Working examples
│ ├── customer-integration.md
│ ├── agent-integration.md
│ ├── annotations.md
│ ├── privacy-masking.md
│ ├── remote-assist.md
│ ├── multi-tab-persistence.md
│ ├── byop-custom-pin.md
│ ├── session-events.md
│ └── auto-reconnection.md
│
├── references/ # API and config references
│ ├── api-reference.md # SDK methods
│ ├── settings-reference.md # Init settings
│ ├── session-events.md # Event types
│ ├── error-codes.md # Error reference
│ ├── get-started.md # Official docs (crawled)
│ ├── features.md # Official docs (crawled)
│ ├── authorization.md # Official docs (crawled)
│ └── api.md # API docs (crawled)
│
└── troubleshooting/ # Problem resolution
├── common-issues.md
├── error-codes.md
├── cors-csp.md
└── browser-compatibility.md
```
## Search Tips
**Find by keyword:**
- "annotation" → [Annotation Tools](examples/annotations.md)
- "mask" or "privacy" → [Privacy Masking](examples/privacy-masking.md)
- "PIN" or "custom PIN" → [BYOP Custom PIN](examples/byop-custom-pin.md)
- "JWT" or "token" → [JWT Authentication](concepts/jwt-authentication.md)
- "error" → [Error Codes](troubleshooting/error-codes.md)
- "CORS" or "CSP" → [CORS and CSP](troubleshooting/cors-csp.md)
- "iframe" → [Agent Integration](examples/agent-integration.md)
- "npm" → [Distribution Methods](concepts/distribution-methods.md), [BYOP](examples/byop-custom-pin.md)
- "refresh" or "reconnect" → [Auto-Reconnection](examples/auto-reconnection.md)
- "agent" → [Agent Integration](examples/agent-integration.md), [Two Roles Pattern](concepts/two-roles-pattern.md)
- "customer" → [Customer Integration](examples/customer-integration.md), [Two Roles Pattern](concepts/two-roles-pattern.md)
---
**Not finding what you need?** Check the [Official Documentation](https://developers.zoom.us/docs/cobrowse-sdk/) or ask on the [Dev Forum](https://devforum.zoom.us/).
## Environment Variables
- See [references/environment-variables.md](references/environment-variables.md) for standardized `.env` keys and where to find each value.
Источник: anthropics/knowledge-work-plugins / zoom-plugin / zoom-cobrowse-sdk ↗. Ссылка проверена 2026-10-10.