The @bundeling/app-sdk is a powerful software development kit that allows developers to easily integrate Bundeling's features into their applications. This guide provides instructions on how to install and use the SDK through npm or by including the prebuilt JavaScript file in your HTML.
To install the @bundeling/app-sdk via npm, follow these steps:
- Ensure you have Node.js installed on your machine. You can verify the installation by running the following commands:
node -v npm -v
- Install the SDK by running the following command:
npm install @bundeling/app-sdk
- Import the SDK in your project:
import { navigate, openFile, shareUrl, openUrl, alert, toast } from '@bundeling/app-sdk';
If you prefer not to use npm, you can include the prebuilt JavaScript file directly in your HTML file. Follow these steps:
-
Download the latest prebuilt JavaScript file from the Bundeling SDK GitHub repository.
-
Add the following script tag to your HTML file, replacing path/to/bundeling-app-sdk.js with the path to the downloaded file:
<script src="path/to/bundeling-app-sdk.js"></script>
When using the SDK through the prebuild JavaScript file, you can access the SDK methods through the window.bundeling object. For example, to navigate to the news page, you can use the following code:
window.bundeling.openUrl('https://bundeling.com/contact');
The @bundeling/app-sdk provides a variety of methods to interact with Bundeling services. Here are the available methods:
Method | Parameters | Description |
---|---|---|
navigate | path: string | Navigates to a specified path within the Bundeling app. |
openFile | url: string | Opens a file in the Bundeling app. |
shareUrl | url: string | Shares a URL using the Bundeling app's sharing functionality. |
openUrl | url: string | Opens a URL in the Bundeling app's browser. |
alert | message: string, title?: string | Displays an alert dialog with a message and an optional title. |
toast | message: string | Displays a toast message at the bottom of the screen. |
The navigate method allows you to navigate to different pages within the Bundeling app.
Example:
navigate.user('123');
Method | Parameters |
---|---|
user | id: string |
userlist | - |
news | id: string |
newslist | - |
event | id: string |
eventlist | - |
message | id: string |
messagelist | - |
chat | id: string |
chatlist | - |
appcms | id: string |
Id's can be a numeric ID or UUID depending on the Bundeling App version
If you encounter any issues or have questions, please check the issues page on the GitHub repository or contact Bundeling support at [email protected].
This project is licensed under the MIT License. See the LICENSE.TXT file for details.