Apps made with Sinbad
An app an agent builds for you does not need accounts at other services for the common things. Sinbad offers them to the app, switched on for each app by its owner (the agent switches them on when your demand needs them, or you do under Ship, then Services). You never put a key in the app's code.
Everything is reached by relative addresses, so the app works at whatever address it is shown at: in the preview, at its own address, or on a domain of its own.
| It needs | Add to the page | What it gives |
|---|---|---|
| AI: a chatbot, an assistant, generated text | <script src="_tidalise/ai.js"></script> | tidalise.ai.chat(messages, options) answers with the reply and can stream it. tidalise.ai.agent(request) runs one run of the app's own agent, which may use the web, memory and email to the owner. |
| Email, files, payments | <script src="_tidalise/app.js"></script> | tidalise.mail.send(...) to the app's owner (a contact form); tidalise.files.upload(file) for a signed-in visitor; tidalise.pay.products() and tidalise.pay.checkout(...) for taking payment. |
| Sign in with Sinbad | <script src="_tidalise/auth.js"></script> | tidalise.auth.ready gives the signed-in visitor or null, tidalise.auth.signIn() signs them in, tidalise.auth.fetch(url) calls your own backend as that visitor. |
AI from server code#
Sinbad has an OpenAI-compatible endpoint. In server code, set the base URL from $AI_BASE_URL and the key from $AI_API_KEY in any OpenAI-compatible client; those are given to the app's own code by Sinbad. In a page, POST the usual chat-completions JSON to the relative URL _tidalise/ai/v1/chat/completions. It runs on the app owner's Sinbad credits, or on the owner's own key at their model provider if they saved one.
Email, files and payments#
- Email goes through Sinbad's own mail provider. From a page it goes to the app's owner only. From the app's server code, with the app's key, it can go to up to ten addresses.
- Files are kept outside the app's code, under the app's own address. A signed-in visitor can save into their own folder, and anyone can read a file at its address. Nothing kept there is run by a browser.
- Payments are made with Stripe: the owner signs up once on Stripe's own pages, and a payment is a Stripe Checkout page paying the owner, with a fee to Sinbad. The page names a product and the price is the owner's. Sinbad does not turn a payment into credits.
Sign in with Sinbad#
In an app that has no sign-in of its own, Sinbad's is the default, and the app's own sign-in is kept if it has one. The visitor's id is stable per person for that app: the app keys its data on it. To check a visitor's token in server code, GET $AUTH_VERIFY_URL with the same Authorization header: 200 returns { id, name, email }, and 401 means not signed in.
Testing without touching anything real#
A preview has a test inbox, a test visitor and test payments, so that an agent, or you, can prove a sign-up, an email or a payment flow without sending a real email or taking real money.
A paused account#
When an account's balance has run out past its overdraft, its apps use nothing of Sinbad's: no AI, no email, no files and no payments, until the owner tops up.
The helper scripts are real files#
An app loads these files at the relative addresses above. They are also served from Sinbad's own address, so you can read exactly what an app runs: ai.js, app.js and auth.js.