dome-embedded-app-sdk
Version:
Use this SDK to build plugins for Dome. There are two plugins supported:
65 lines (40 loc) • 2.43 kB
Markdown
Use this SDK to build plugins for Dome. There are two plugins supported:
1. Cards : Extend the functionality of Dome by adding custom cards.
2. Document Viewer : Add support for editing & viewing any document in Dome.
A "card" in Dome enables you to extend the functionality of a dome. Each "card" is like a mini website (webapp) that you can build as per your needs. Each dome is made up of cards. By adding your custom card to your dome, you can extend it's functionality.
Use this SDK to create your custom card that can do whatever you like: a simple todo list, snake & ladder game, to a complex project management tool, a 3D AR visualization, to anything else you can imagine! Anything you can build in React or Angular can be created into a card!
As of Dec 2024, we support Angular and React cards. In future, we will add support for more frameworks.
### Getting Started with your first Card
#### Register your card
Register your card at <https://dev.dome.so>
#### Code
Import the SDK
```JavaScript
import { CardSdk } from "dome-embedded-app-sdk";
```
Call init to get instance of the SDK. It takes a secret and event handler as input.
```JavaScript
CardSdk.init(my_dev_card_secret, {
onInit: (data: any) => {
this.user = data?.user;
this.api_token = data?.api_token;
},
onError: (error_code: string | number, message: string, data: any) => {
console.error("Some Error", message + "(" + error_code + ")");
},
onRefreshRequest: (data: any) => {
console.debug("Refresh requested", data);
}
})
```
Note: the `secret` is given to you when you register your card (step 1)
### Deploy
Deploy your code at <https://dev.dome.so>
## 2. Document Viewer
Add view / edit capability for any document in Dome. For example, you can come up with your own spreadsheet and make it instantly available to all users of Dome. Alternatively, you can create your own viewer that views & (optionally) edits existing documents such as Excel files. The options a limitless!
As of Dec 2024, we support Angular and React document viewers. In future, we will add support for more frameworks.
### Getting Started with your first Document Viewer
## Help
Join our developer community on Dome here: <url>. Hang out, get latest updates, ask questions, experience Dome, and much more!