This is the demo that shows how the AppEmbeddedSDK works. Below are the steps to help you start.
- Clone the Apps.engine repo and checkout the
alpha
branch
git clone git@github.com:RocketChat/Rocket.Chat.Apps-engine.git
cd Rocket.Chat.Apps-engine
git checkout -b alpha origin/alpha
- Install the depencies and compile the project
npm install
npm run compile
- Import AppEmbeddedSDK
import { AppEmbeddedSDK } from '[the path to apps.engine]/apps.engine/client/AppEmbeddedSDK';
- Create instance and call the API
async getUserInfo() {
const sdk = new AppEmbeddedSDK();
const user = await sdk.getUserInfo();
console.log(JSON.stringify(user, null, 4));
}
Please see here for the detail.