dome-embedded-app-sdk
v0.4.3
Published
Build Dome cards and document viewers with a single SDK. Cards let you extend a dome with custom functionality, while viewers let you render and edit documents inside Dome.
Readme
Dome Embedded App SDK
Build Dome cards and document viewers with a single SDK. Cards let you extend a dome with custom functionality, while viewers let you render and edit documents inside Dome.
Install
npm install dome-embedded-app-sdkWhat you can build
Cards
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!
Document viewers
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!
Note: We currently support React and Angular, with support for more frameworks planned in the future.
Getting started
- Register your card or viewer at https://dome.so/developer.
- Initialize the SDK in your app.
- Handle lifecycle events and call SDK APIs.
For more detail, check out the Guides
Cards quick start
import { CardSdk, getKeyFromBlob } from "dome-embedded-app-sdk";
const my_card_decryption_blob = {...};
CardSdk.init(getKeyFromBlob(my_card_decryption_blob), {
onInit: (data) => {
console.log("Init payload", data);
},
onError: ({ error_code, message }) => {
console.error("Some Error", `${message} (${error_code})`);
}
}).then((sdk) => console.log("SDK Instance", sdk));Document viewer quick start
import { ViewerSdk } from "dome-embedded-app-sdk";
ViewerSdk.init({
onInitialData: ({ doc, ui }) => {
console.log("Initial doc", doc, ui);
},
onDataChange: ({ doc }) => {
console.log("Doc updated", doc);
},
onCloseRequest: () => {
console.log("Close requested");
},
onSaveRequest: () => {
console.log("Save requested");
}
});Guides
Starter projects
- React card starter: https://github.com/DomeHQ/card-react_starter
- Angular card starter: https://github.com/DomeHQ/card-angular_starter
Help
Join our developer community on Dome here: https://dome.so/developer. Hang out, get latest updates, ask questions, and get support.
