1.4 KiB
1.4 KiB
CRM Sample Validation (https://github.com/zoom/CRM-Sample)
Useful architecture patterns adopted
- Smart Embed as dedicated iframe sidebar component.
- Server-only OAuth token handling with
next-authcallbacks. - API route pattern that reads session token and calls Phone APIs.
- Client-side event listener for Smart Embed message events.
Environment keys observed in sample
ZOOM_CLIENT_IDZOOM_CLIENT_SECRETNEXTAUTH_URLNEXTAUTH_SECRET
Lifecycle pattern extracted
- User authenticates with Zoom OAuth.
- Server stores access/refresh token session state.
- UI renders Smart Embed iframe.
- UI sends click-to-call command and listens for events.
- Backend fetches call history/contact data for CRM views.
Contradictions and drift issues found
- Sample still maps response via
data.call_logs(legacy shape) while migration docs push toward call history/call element shapes. - README references
.env.example, repository provides.env.sample. - Middleware matcher and route naming are inconsistent (
/call-logvs/call-logs, missing/api/calls/[id]route used by modal). - Sample contains hardcoded demo records in some screens alongside live API calls.
Guidance
- Treat sample as architectural reference, not canonical API contract.
- Apply migration-safe normalizers for call history fields.
- Validate each endpoint payload against current Phone API docs.