API Examples
This example illustrates how Docula, a collaborative online document editor, might integrate Lordicon icons into its platform while aligning with proper usage tracking practices.
Use Case Overview
Docula wants to enhance user documents with animated decorative icons. To do this efficiently and transparently, it integrates the Lordicon API and implements tracking in a way that reflects actual usage.
Integration Scenario
Docula builds a predefined set of icons available to users for decorating their documents.
This icon set is generated once and reused across the platform for all users.
Each icon added to this set should be reported as 1 tracked download, but only once when the set is created.
What Should Not Be Tracked
To ensure fair and accurate usage reporting, Docula should not report downloads in the following cases:
When users browse the icon library in the interface to select an icon.
When users customize an icon’s properties (color, stroke width, animation type or speed) without inserting it into a document.
When users preview icon variations or adjust settings but do not use the icon in the final content.
When icons are viewed in a document (by the owner or collaborators), either in edit or view mode.
What Should Be Tracked
Docula should track and report a download in the following situations:
- When a user inserts a chosen icon into a document.
If the same icon is inserted again with different settings (color, stroke, animation speed or type), each variant counts as a separate download.
If a user duplicates an icon already inserted into the document.
If a user copies an icon from one document and pastes it into another, this also counts as a new download.
Summary
This usage model ensures fair reporting while offering flexibility to users. The goal is to track actual usage — meaning icons that become part of user-created content — not passive interactions like browsing or customization previews.
For implementation details and full API reference, visit: https://lordicon.com/api-developers