How zohodevelopers/embeddedapp-js-sdk works
Main Components
• Core SDK Library – Represented by the files in the lib directory (e.g., ZSDK.js and ZohoCrmHelper.js). This is the heart of your SDK that handles event subscriptions, initialization, and communication with the Zoho CRM ecosystem.
• Documentation Generator – The jaguarjs-jsdoc folder contains Grunt scripts, Less (CSS) files, templates (tmpl), and static assets. It is used to generate documentation for the SDK.
• Test Suite – The test directory houses various HTML and JS test files that are used to simulate and validate the behavior of the SDK.
• Configuration/Build Tools – Files such as build.gradle, conf.json, and package.json (in jaguarjs-jsdoc) indicate that there is an automated build/deployment and configuration setup.
Relationships & Interactions
• The Core SDK receives initialization calls and event registrations from client applications (shown in sample code from the README). It then uses internal logic (possibly through helper functions) to interact with Zoho CRM’s embedded environment.
• The Documentation Generator is used separately to automatically parse the SDK source code, apply doc templates, and produce user documentation. It is not invoked at runtime in a production environment but is essential for external users.
• The tests interact with the SDK by including it in HTML pages and running sample scenarios. This validates the event binding and functionality provided by the library.
• The build and configuration tools coordinate how the library and documentation are built/deployed.
Architectural Patterns/Design Principles
• Modularity – There is a clear separation between the core library (logic and helper modules), the documentation generation system, and the testing framework.
• Event-driven Design – The README sample shows that the SDK uses an event subscription (pub/sub-like) mechanism to notify client code about dynamic events from the CRM environment.
• Separation of Concerns – Code related to documentation (jaguarjs-jsdoc) is separated from the core business logic (lib/) and tests.