Skip to main content

Introduction to the SDK

Your Extension needs to interact with all the components on the platform, such as the side menu, the bottom image selector, notifications, modals, etc. To fulfil this function, we provide a Javascript SDK that will allow you to do so.

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!

  <script src="https://auraview.auravant.com/sdk/v1.0/aura-package_v1.0.js"></script>

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 avt.test.hiAuravant().

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.

SDK in development

To make your life easier, we developed the @auravant/sdk-types package that you can install from npm as a development dependency so you can access modules and features quickly in your IDE. In addition, in case you are using TypeScript, this will fix possible IDE errors for variables not being declared.

We recommend installing it as a development dependency. That is, adding it to devDependencies inside your project's package.json, or run the following in your terminal (within your project):

npm install -D @auravant/sdk-types

If you are using TypeScript for your extension, you may need to add "types": ["./node_modules/@auravant/sdk-types"] inside compilerOptions in the tsconfig.json file.