Every SGApps web application is available at:
https://sgapps.io/online/webapp/{app-name}Embed with a standard <iframe>:
<iframe
id="sgapps-editor"
src="https://sgapps.io/online/webapp/photo-editor"
width="100%"
height="600"
frameborder="0"
allow="camera; microphone; clipboard-write"
></iframe>allow Attributes| Permission | Needed By |
|---|---|
camera | Recorder |
microphone | Recorder, ChatBox |
clipboard-write | Code Editor, File Manager |
fullscreen | All apps (fullscreen button) |
/online/webapp/{app-name}Opens the app with its default demo arguments (if configured). For Photo Editor this loads a sample image.
/online/webapp/{app-name}/url/{base64-encoded-url}The third segment is the URL base64-encoded with btoa():
var url = "https://example.com/image.jpg";
var src = "https://sgapps.io/online/webapp/photo-editor/url/" + btoa(url);/online/webapp/{app-name}/file/{base64-encoded-path}For authenticated users, opens a file from their GridFS storage.
By default, the app renders with window chrome (title bar, controls). For a cleaner embed, enable embed mode via the WindowSocket API:
socket.fire("webapp::instance::embed-mode", true, function (err, isEmbedded) {
// App is now maximized with no title bar
});This:
webapp-instance--embed-mode class to the bodyDisable embed mode:
socket.fire("webapp::instance::embed-mode", false, function (err, isEmbedded) {
// Window chrome is restored
});The webapp container auto-resizes to fill the iframe viewport. A polling loop (500ms) adjusts the container height to account for the top bar and footer. For best results, set the iframe to fill its parent:
iframe {
width: 100%;
height: 100vh;
border: none;
}The apps are hosted on sgapps.io. When embedding from a different domain, the WindowSocket API uses postMessage which works cross-origin. No special CORS headers are needed for the iframe itself, but if you need to load files from your domain into the app, they must be accessible via a public URL.
| App Name | URL Slug |
|---|---|
| Photo Editor | photo-editor |
| SVG Editor | svg-editor |
| Code Editor | code-editor |
| Archive Viewer | archive-viewer |
| Media Player | media-player |
| Recorder | recorder |
| File Manager | file-manager |
| Presentation | presentation |
| GCode Editor | gcode-editor |
| CNC GCode Simulator | cnc-gcode-simulator |
| ChatBox | chatbox |
| SVFS Manager | svfs-manager |
| SSH Web Client | ssh-web-client |