Admin SDK is a JavaScript library that allows apps to communicate with the Open2b platform:
<script src="https://open2b.dev/admin-sdk/open2b-admin-sdk-v7.5.min.js"></script>
When the app goes into production, it is always preferable to download the Admin SDK script and host it on your own servers.
The following functions are provided:
| Admin.api | Calls an API method (latest version) and returns the response. |
|---|---|
| Admin.apiVersion | Calls an API method in a specific version and returns the response. |
| Admin.closeDialog | Closes the currently open dialog window. |
| Admin.getAuthRequest | Returns the string used by server-side applications to authenticate the store. |
| Admin.getInfo | Returns information such as API versions and the user's locale. |
| Admin.Labels.set | Sets the name and color of labels. |
| Admin.Menus.clear | Removes all app menu entries. |
| Admin.Menus.create | Creates a new menu entry or replaces an existing one. |
| Admin.Menus.remove | Removes one or more app entries from a menu. |
| Admin.Menus.find | Returns the entries in a specific menu or in all menus. |
| Admin.Snippets.clear | Removes all snippets. |
| Admin.Snippets.create | Creates a new snippet or replaces an existing one. |
| Admin.Snippets.remove | Removes one or more snippets. |
| Admin.Snippets.find | Returns the requested snippets. |
| Admin.Storage.clear | Removes all the app keys and values from storage. |
| Admin.Storage.remove | Removes keys from storage. |
| Admin.Storage.get | Returns values associated with keys. |
| Admin.Storage.set | Adds new keys or updates existing ones. |