Usage
The SDK API is used through an async function which is attached to the window globally.
The API functions can be used anywhere in the code, but must be placed after the snippet from the install step.
Any use will start with:
window.AE_SDK(async (thrownError, AE_SDK_API) => {
// usage here, for example:
await AE_SDK_API.initialize();
await AE_SDK_API.auth.login();
});
All the examples in the docs are in typescript.
The given callback can be either sync or async.
The given callbacks will be run in sequence mode.
The actual function (window.AE_SDK
) is with a void
return type, so it doesn't give an indication for completion of the callback.
The Initialize API function must be called before anything else, whether it's auto-initialized or manually, as described in the initialize docs.