In a nutshell, the SDK provides a mechanism for you to perform operations on the main interface of the platform, either its web or mobile version. On the other hand, it also wraps commonly used functions of our APIs, making it much easier to call them.
Include the SDK in your code
To include the SDK in your code, simply add the public aura-package script in your HTML file, always make sure you use the latest version available!
In the sdk, we have useful global variables to know the environment of our application.
- platform: tells us which device our application is running on, returns "web", "android" or "ios" as appropriate.
console.log("Running extension from the web platform!")
- token: provides us with a token in string format, necessary to use the APIs detailed here.
Authorization: "Bearer " + token
console.log("Using the API with my token")
Organization of the functions
All SDK functions will be accessible through the
avt namespace. Within that space there are
different modules and within each module you will find the functions. For example if you want
to execute the function 'hiAuravant()' of the module 'test' you must call
Synchronous and asynchronous functions
An important note before we start. Within the available functions you will see that all of them have an asynchronous version (you will notice since they have 'async' in their name) as well as in some cases synchronous versions will be available. It is important to mention that we recommend always using the asynchronous versions that return a promise.