--- name: five9-crm-sdk description: 'Build, customize, review, or debug browser integrations using the Five9 CRM SDK and Agent Desktop Toolkit Plus. Use for CRM callbacks, click-to-dial, screen pop, call logging, interaction events, presence, hooks, custom ADT components, and Salesforce Open CTI.' argument-hint: 'Describe the Five9 CRM SDK integration or issue' user-invocable: true disable-model-invocation: false --- # Five9 CRM SDK Use the official Five9 CRM SDK JavaScript library to integrate a CRM page with Five9 Agent Desktop Toolkit Plus (ADT), or to customize an existing integration. ## Workflow 1. Identify the integration mode: - New embedded integration: the page owns the ADT iframe and implements `CrmApi` callbacks. - Existing Five9 integration customization: use `InteractionApi` and `HookApi`; Five9 already owns the CRM layer. - Proxy page: a custom HTTPS page hosts ADT and communicates with the parent CRM. 2. Inspect the iframe URL, SDK loading method, callback registrations, and event subscriptions. 3. Route to the smallest owning API using [API reference](./references/api-reference.md). 4. Consult [integration guide](./references/integration-guide.md) for loading, regional URLs, lifecycle constraints, and implementation patterns. 5. Verify exact method signatures against the live official JSDoc before generating calls with parameter structures not shown in these references. 6. Handle Promise rejection paths and preserve documented callback return shapes. 7. Test in the actual frame/tab topology because communication uses browser `postMessage`. ## Non-Negotiable Rules - Load `https://cdn.prod.us.five9.net/stable/crm-sdk-lib/five9.crm.sdk.js` unless the project deliberately self-hosts an approved version. - Confirm the customer's region before choosing the US or Europe ADT URL. - Register at most one Hook API implementation. - Treat interaction data as ephemeral and capture needed values before the interaction finishes. - Call `ApplicationApi.getConfig()` only while login state is `WORKING`. - Use `InteractionApi.isMasterPage()` for work that must occur once across multiple SDK instances. - Never expose credentials, tokens, SSO assertions, or customer interaction data in source, URLs, or logs.