Installation
SDK can be connected in two ways:
- as an npm package (ESM/CJS) for Node.js and bundlers
- as a UMD bundle in the browser via a
<script>tag
Node.js
Requirement
Supported versions ^18.0.0 || ^20.0.0 || >=22.0.0
bash
npm install @aspro-cloud/miniapp-jssdkbash
yarn add @aspro-cloud/miniapp-jssdkImport the library into your project:
ts
import { App, Frame, Toast } from '@aspro-cloud/miniapp-jssdk'ts
const { App, Frame, Toast } = require('@aspro-cloud/miniapp-jssdk')UMD
Via CDN
Include the library directly via CDN — add a <script> tag with the latest version to your HTML file:
html
<script src="https://unpkg.com/@aspro-cloud/miniapp-jssdk@latest/dist/miniapp-jssdk.min.js"></script>Local import
If you prefer to keep the library file in your project, first download the library from the CDN and add it to your project.
Then include the file in your HTML:
html
<script src="/path/to/miniapp-jssdk.min.js"></script>After including the script, the SDK is available via the global variable ACloudMiniApp:
js
const App = window.ACloudMiniApp;
const Frame = App.Frame;
const Toast = Frame.Toast;