Skip to content

SDK overview

import { Aside } from ‘@astrojs/starlight/components’;

Published artifacts ship with a browser SDK. Drop in one script tag and your page gets storage, file uploads, realtime collaboration, email, Python, and an AI chat agent — no backend to wire up.

<script src="https://shareout.site/sdk/shareout.js"></script>
<script>
const sdk = await ShareOut.create();
</script>
// Preferred for published HTML — waits for the sandbox session token
const sdk = await ShareOut.create();
// Sync constructor — fine for local/mock, racey for live data in an iframe
const sdk = new ShareOut();

artifactId and baseUrl are auto-detected from the URL. Published artifacts run in a sandboxed iframe; create() waits for the short-lived token the parent frame injects.

On file://, localhost, or 127.0.0.1 the SDK auto-switches to a localStorage mock — no network, no auth. Force it with new ShareOut({ mock: true }), clear it with sdk.clearMockData().

TierAPIFor
1sdk.jsonSimple state — prefs, flags, cached values
2sdk.table(name)Structured records — tasks, leads, entries
3sdk.realtime(id)Live collaboration — docs, whiteboards
APIDoes
sdk.blobsFile storage, served direct from R2
sdk.emailContact-form email to the artifact owner
sdk.pythonRun Python in the browser (Pyodide)
sdk.agentAI chat agent powered by Claude
sdk.commentsThreaded comments
sdk.sheets / sdk.shopifyIntegrations

Most stores require you to declare their keys/schemas in a manifest block in your HTML <head>:

<script type="shareout/manifest">
{ "version": "2.0", "sources": { "json": { "counter": { "default": 0 } } } }
</script>

Each store page below shows its manifest shape.

try {
await sdk.json.get('key');
} catch (e) {
if (e instanceof ShareOutError) console.log(e.code, e.status, e.message);
}