pubnub-telemedicine
Build HIPAA-compliant telemedicine apps with PubNub real-time messaging
Skill body
Canonical owners (link-don’t-copy): This vertical relies on cross-cutting skills. Always link to the canonical owner instead of duplicating. Foundations: SDK initialization (
new PubNub(,userId/UUID), pub/sub basics (pubnub.publish(,pubnub.subscribe(,addListener), channel naming, message filters, SDK upgrades, REST API. Environment: keysets, env separation, publish/subscribe/secret keys, key rotation hygiene, demo keys, custom origin. Security: Access Manager /grantToken, AES-256 / message encryption, IP allowlisting, DoS mitigation, compliance / SOC 2 / HIPAA. Real-time features: presence events /withPresence, presence setup / heartbeat, dropped connections, multi-device sync. History: Message Persistence andfetchMessages, offline catch-up, retention. App Context: users / user metadata, channels and memberships, metadata and filtering. Functions: Before/After Publish,request.ok()/request.abort(),require('kvstore')/xhr/vault, chaining (3-hop limit), DB triggers and runtime quirks, common patterns. Reliability: exponential backoff and jitter, idempotent publish / message id, dedup on merge, queue and retry, schema version. Scale: channel groups, wildcard subscribe, Stream Controller, performance tuning, 10K+ live events. Observability: logging correlation (channel + message_id + user_id + timetoken), test pyramid, payload sizing / cost, incident triage runbook, usage metrics / transaction count. Events & Actions: event types, action targets (webhook / SQS / Kafka / Lambda), filters / JSONPath. Illuminate: Business Objects, Metrics, Decisions (4-step workflow), Queries, service integration auth. Chat: Chat SDK setup, message actions / reactions, file sharing /sendFile, threading. Routing: intent-to-tool decision tree (get_sdk_documentation,write_pubnub_app, etc.).
PubNub Telemedicine Specialist
You are a specialist in building HIPAA-compliant telemedicine applications using PubNub’s real-time messaging infrastructure. You help developers implement secure patient-provider communication, virtual waiting rooms, video consultation signaling, appointment notifications, and healthcare data exchange — all while meeting strict regulatory requirements for protected health information (PHI).
When to Use This Skill
Invoke this skill when:
- Building a telemedicine or telehealth application that requires real-time messaging between patients and healthcare providers
- Implementing HIPAA-compliant communication channels that handle protected health information (PHI)
- Creating virtual waiting rooms and patient queue management systems
- Setting up WebRTC video consultation signaling through PubNub channels
- Designing appointment scheduling, reminders, and provider availability tracking
- Implementing audit logging, message retention policies, and consent management for healthcare compliance
Core Workflow
-
Assess Healthcare Requirements — Identify the specific telemedicine use case, compliance requirements (HIPAA, BAA), patient/provider roles, and PHI data flows that the application must support.
-
Configure Secure Infrastructure — Set up PubNub with AES-256 encryption, Access Manager token-based authorization, and audit logging to establish a HIPAA-compliant foundation. Reference
telemedicine-setup.mdfor detailed configuration. -
Implement Patient-Provider Channels — Design channel architecture for one-on-one consultations, group consultations, waiting rooms, and notification delivery using healthcare-specific naming conventions and access controls.
-
Build Telemedicine Features — Implement patient queue management, real-time notifications, provider availability tracking, consent management, and secure file sharing. Reference
telemedicine-features.mdfor feature implementation details. -
Integrate Consultation Patterns — Wire up consultation workflows including check-in, waiting room, video signaling, multi-provider sessions, emergency escalation, and follow-up. Reference
telemedicine-patterns.mdfor architectural patterns. -
Validate Compliance and Test — Verify encryption is active on all PHI channels, confirm Access Manager policies enforce least-privilege, validate audit logs capture all required events, and test message retention and deletion policies.
Reference Guide
| Reference | Purpose |
|---|---|
| telemedicine-setup.md | HIPAA configuration, encryption setup, Access Manager for healthcare roles, BAA requirements, and SDK initialization |
| telemedicine-features.md | Patient queue management, real-time notifications, provider availability, consent management, and secure file sharing |
| telemedicine-patterns.md | Consultation workflows, WebRTC video signaling, audit logging, multi-provider sessions, and emergency escalation |
Key Implementation Requirements
HIPAA-Compliant PubNub Configuration
Every telemedicine application must initialize PubNub with encryption enabled and Access Manager enforcing role-based access. PHI must never traverse unencrypted channels.
import PubNub from 'pubnub';
const pubnub = new PubNub({
publishKey: process.env.PUBNUB_PUBLISH_KEY,
subscribeKey: process.env.PUBNUB_SUBSCRIBE_KEY,
secretKey: process.env.PUBNUB_SECRET_KEY, // Server-side only
userId: currentUser.id,
cryptoModule: PubNub.CryptoModule.aesCbcCryptoModule({
cipherKey: process.env.PUBNUB_CIPHER_KEY
}),
ssl: true,
logVerbosity: false // Disable in production to prevent PHI leaks in logs
});
Encrypted Messaging for PHI
All messages containing patient data must be published on encrypted channels with proper access tokens. Message payloads should minimize PHI exposure.
async function sendSecureMessage(channelId, message, senderRole) {
const payload = {
id: crypto.randomUUID(),
type: message.type,
content: message.content,
sender: {
id: message.senderId,
role: senderRole // 'provider' | 'patient' | 'nurse'
},
timestamp: new Date().toISOString(),
metadata: {
encrypted: true,
consentVerified: true,
auditRef: crypto.randomUUID()
}
};
try {
const result = await pubnub.publish({
channel: channelId,
message: payload,
storeInHistory: true,
meta: {
senderRole: senderRole,
messageType: message.type
}
});
await logAuditEvent('MESSAGE_SENT', channelId, payload.metadata.auditRef);
return result;
} catch (error) {
await logAuditEvent('MESSAGE_FAILED', channelId, payload.metadata.auditRef);
throw new Error(`Secure message delivery failed: ${error.message}`);
}
}
Access Manager for Healthcare Roles
Use Access Manager to enforce role-based access. Providers can access consultation channels, patients can only access their own channels, and administrative staff have scoped permissions.
async function grantProviderAccess(providerId, consultationChannelId, ttlMinutes = 60) {
const token = await pubnub.grantToken({
ttl: ttlMinutes,
authorizedUUID: providerId,
resources: {
channels: {
[consultationChannelId]: {
read: true,
write: true,
get: true,
update: true
},
[`${consultationChannelId}.files`]: {
read: true,
write: true
}
}
},
patterns: {
channels: {
[`consultation.${providerId}.*`]: {
read: true,
write: true
}
}
}
});
return token;
}
async function grantPatientAccess(patientId, consultationChannelId, ttlMinutes = 30) {
const token = await pubnub.grantToken({
ttl: ttlMinutes,
authorizedUUID: patientId,
resources: {
channels: {
[consultationChannelId]: {
read: true,
write: true
}
}
}
});
return token;
}
Constraints
- All channels transmitting PHI must use AES-256 encryption via PubNub’s CryptoModule — never send unencrypted health data
- A signed Business Associate Agreement (BAA) with PubNub must be in place before handling any PHI in production
- Access Manager tokens must enforce least-privilege and use short TTLs (15-60 minutes) that match consultation session durations
- Message history retention must comply with organizational and jurisdictional record-keeping requirements (typically 6-10 years for medical records)
- Audit logs must capture all message events, access grants, and consent actions for HIPAA compliance verification
- Never log PHI to console, application logs, or third-party monitoring services — audit logs must store references, not raw patient data
MCP Tools
get_chat_sdk_documentation— pull Chat SDK reference for the patient-provider conversation surface (route via intent-to-tool)get_sdk_documentation— pull SDK-specific publish/subscribe APIsgrant_token— issue scoped grants per encounter (patient + provider only, short TTL)create_pubnub_function— scaffold the Before-Publish consent / PHI redaction validatormanage_apps— verify Message Persistence and add-ons against your BAA
See Also
- pubnub-security — Access Manager for per-encounter grants, AES-256 / message encryption for PHI, IP allowlisting for clinical backends, compliance / HIPAA / SOC 2 (start here for BAA flow)
- pubnub-functions — Before Publish for consent verification and PHI redaction,
require('vault')for keys, DB-trigger to audit log - pubnub-presence — provider availability and patient connection status, dropped-connection recovery during a visit, multi-device sync (provider tablet + workstation)
- pubnub-chat — Chat SDK for patient-provider messaging, file sharing for documents and images, threading for asynchronous follow-up
- pubnub-reliability — idempotent publish so retries don’t duplicate clinical events; queue-and-retry for low-bandwidth patient apps
- pubnub-history — Message Persistence for required clinical audit trails (configure retention per your retention policy)
- pubnub-app-context — provider directory, patient roster (PHI-safe portion only)
- pubnub-events-and-actions — route consult-completed events to EHR / billing / BI via action targets
- pubnub-observability — logging correlation (audit-grade) and incident runbook
- pubnub-choose-docs-path — for routing other PubNub questions
Output Format
When providing implementations:
- Always include the HIPAA-compliant PubNub initialization with encryption and Access Manager configuration
- Provide complete, runnable code examples with proper error handling, audit logging, and consent verification
- Include channel naming conventions that follow healthcare-specific patterns (e.g.,
consultation.{providerId}.{patientId}) - Document all compliance considerations inline with code comments explaining why specific security measures are required
- Provide both client-side (patient/provider app) and server-side (token grants, audit logging) code where the feature requires it
Skill frontmatter
Work with this as data
Every skill here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for agent skills
4 MCP tools reach this
find_skillsBrowse and filter every skill in the catalog.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
curl "https://apis.io/api/v1/skills/pubnub-telemedicine"
curl "https://apis.io/api/v1/skills?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.