Code on your own pages
Load this in the page head, without defer:
<script src="https://simple-host.app/auth.js"></script>
-
Create a SQLite resource named
notes, anotestable withid INTEGER PRIMARY KEY,visitor_id TEXT, andtext TEXT, and the personal preset through the owner API or connector. Follow Storage and saved data. -
Add
<div id="sh-auth"></div>to the page and mount sign-in from your page’s JavaScript:await SH.mount('#sh-auth'); -
On the save button, sign in and add a row:
await SH.requireSignIn(); const notes = SH.storage.sqlite('notes').table('notes'); await notes.add({text: 'Bring the projector'}); -
Read it back and render text with
textContent:const result = await notes.list({limit: 20}); document.querySelector('#notes').textContent = result.items.map(row => row.text).join('\n');
Add a #notes element for the result. On a custom domain, set window.SH_CONFIG = {site:'your-site'} before loading auth.js. Keep API keys out of page code; use the visitor session for saves.