For modern and robust applications, we recommend using the npm installation method, as it provides version management.
How to Use
CDN integration is straightforward and involves just two steps.1
Add the Script to your HTML
To begin, add the following <script> tag inside the <head> tag of your main HTML file. Placing it in the <head> ensures the SDK is loaded before any of your own scripts are executed.
2
Access the Global TitanSDK Variable
After the script is loaded, it will create a global object named TitanSDK on the window object. You can access it directly in your JavaScript files to start using the SDK’s functionalities.
Usage Example
Here is a practical example of how to fetch device information using the CDN method. Note that, just like the npm version, function calls are asynchronous.Next Steps
Introduction to Titan SDK
View the main documentation and the recommended npm installation method.
Migration Guide
Consult the detailed guide for migrating from the old DeviceInfo API.