@seatalk/web-app-sdk
v1.5.0
Published
SeaTalk Web App SDK
Downloads
11
Readme
SeaTalk Web App SDK
Web SDK provides a package of essential and value-add functions for your web app to deliver a better user experience. To official website, you can find the following three sub-sections:
- Get Started: a guide to adding Web SDK into your web app.
- Functions: the available web SDK functions your app can tap into.
- Web SDK Error Code: the information you need for troubleshooting.
How to Use Web SDK
We suggest you look through the functions provided by SeaTalk Open Platform to understand what capabilities might be needed for your app. Then, to use Web SDK, there are two steps that need to be done: installation of Web SDK and actual usage of functions.
Install Web SDK npm Package
@seatalk/web-app-sdk provides all the functions that your web app needs to interact with SeaTalk. Run the following command to install the Web SDK npm package:
npm install @seatalk/web-app-sdk
Call Function
You need a bundler such as Webpack or Parcel to import @seatalk/web-app-sdk as a module in your web app. Once the module is imported, you can call the functions your web app needs.
For example, the following code snippet shows the how the Toast function is used:
import { toast } from '@seatalk/web-app-sdk';
toast({ message: 'hello world' });
Note:
@seatalk/web-app-sdk
comes with type definitions (TypeScript).