Build sites and apps with Nabula
Describe what you want, and Nabula's AI builds it: pages, a database, user accounts, a custom domain, even Android and iOS apps. This guide explains how each part works for the sites and apps you build.
Your site's database
Every site built with Nabula gets its own built-in database. You don't need to set up servers or connect an outside service. Just tell the AI what you want to store.
Entities
Data is organized into entities. Each entity is a type of thing your site stores, like Products, Orders, Blog posts or Bookings. An entity has fields (name, price, date, image, a link to another entity, a fixed list of options, and more).
- Ask in plain words: "Add a menu with dishes, prices and categories". The AI creates the entity, its fields and the pages that use it.
- Changing a structure is safe. When a field is removed or changes type, existing records are kept, and the old field is marked as deprecated instead of being deleted.
- Entities you no longer need can be archived without losing their data.
- Each site's data is fully separated from every other site on Nabula.
Records
Each item stored in an entity is a record. Open the Data tab in the editor to see every entity and its records. From there you can:
- Browse, add, edit and delete records by hand.
- Ask the AI to add sample content, or to update or delete records in bulk.
- Change business content (menu items, products, team members) from the Data tab instead of editing code. Nabula's AI always keeps this kind of content in the database, so it stays easy to update.
Permissions
Each entity has permissions for read, create, update and delete. They decide who can do what: anyone, signed-in users, only the record's owner, or only admins. Permissions are enforced on the server, so visitors can't get around them from their browser. When a record is created by a signed-in user, it remembers its owner, so "only my own records" rules work automatically.
Cost
The database is included on every plan, including Free. A chat request that creates or changes data or auth is charged like any other chat request, by its AI usage. See the credits breakdown.
User accounts on your site
Let visitors sign up and log in to your site or app. Nabula comes with a complete login system built in. Ask the AI to "add login" or "let customers create accounts".
Email & password
- The AI adds ready-made sign-up and login screens to your site, styled to match it.
- Passwords are never stored as plain text. Each one is hashed with its own random salt.
- Logged-in sessions use secure tokens that expire.
- Each user has a role, user or admin. You can build admin-only pages and data on top of roles.
- Users can keep extra profile details (name, phone, preferences) on their account.
Google sign-in
Turn on Sign in with Google from the Auth tab in the editor. It uses your own Google OAuth app. Your keys are stored encrypted as secrets and are never shown to visitors. A setup guide inside the editor walks you through creating the Google keys step by step.
Managing users
The Auth tab lists everyone who has signed up to your site. You can see their email, name and role, and make someone an admin.
When sign-in is added to your site, Nabula creates your own admin account on it, with your email and a random password. The Auth tab shows that password on request and lets you change it. Only you, the project owner, can see it.
Auth is included on every plan.
Custom domains and publishing
Every site can go live on a free Nabula subdomain, like mybakery.nabula.app, on every plan. On the Pro plan and above you can also put it live on a domain you own, like www.mybakery.com.
Nabula subdomain
- Press Publish. If the site has no verified custom domain, Nabula picks a free address for it and publishes it there. No setup is needed, and the address is secured with https.
- The address is as close as possible to your site's name. If that name is taken, a number or a few letters are added. A site whose name isn't in English gets a random address.
- The address stays the same every time you publish again.
- Change the address: while the site is live on a Nabula subdomain, open Settings → Domain, type a new name and press Update & publish. The site is published on the new address first and leaves the old one only when that succeeded, so if the new name is taken or the publish fails, nothing changes. The old address then becomes free for others.
- When you connect and verify a custom domain and publish again, the site moves to your domain and leaves the Nabula subdomain, which becomes free for others. A site is live in one place at a time.
The rest of this section is about custom domains, available on the Pro plan and above.
Connect a domain
- In the editor, open Settings → Domain and enter your domain.
- Open DNS instructions and add the CNAME record it shows at your domain provider (GoDaddy, Namecheap, Cloudflare, and others).
- Click Verify. Nabula checks the DNS record and issues a free SSL certificate (https) automatically. DNS changes can take anywhere from a few minutes to 24 hours.
- Once the domain shows Verified, publish your site.
A domain can only be connected to one Nabula site at a time.
Additional domains
The same site can be served on more domains, for example a test subdomain next to your main domain. You can add up to 10 additional domains. Each one needs its own CNAME record and its own verification.
Publish & unpublish
- Publish builds a fast production version of your site and serves it on your verified domains. If your site has backend functions, a snapshot of them is published along with it.
- Keep editing freely after you publish. Visitors only see changes when you publish again.
- Unpublish takes the site offline right away. Your project and data stay untouched.
- Once published, your live link appears in the Preview tab.
- Versions: the top of the editor shows the project's version and the version that is live. Every build request to the AI is a new version, and publishing makes the current version the live one. When the two differ, a red note reminds you that the live site still runs the older version, so new features (for example a new backend function or workflow) won't work in the browser until you publish. Reverting a message returns the project to the version before it.
Remove a domain
Each connected domain has a remove button. After you confirm, the domain is disconnected and the site is no longer available on it. To remove your main domain, first remove any additional domains. If the site is live, removing the main domain unpublishes it.
Plans, payments and credits
Nabula has a plan for every stage, billed monthly or yearly. All prices are in US dollars and charged by card through our secure payment provider. On yearly billing the price per month is lower and 12 months are charged in one payment, once a year. Credits refresh every month on both. We never see or store your card number.
Plans
Free
100 credits / month
- Unlimited sites
- Default AI model
- Built-in auth & database
- Publish on a Nabula subdomain
- Plan mode
- Download project as ZIP
Pro
900 credits + 12,500 integration credits / month
- Everything in Free
- Unlimited sites
- Connect a custom domain
- Choose the AI model
- Visual edits
- Built-in file storage
- SEO tools
- Remove the Nabula badge
- Backend functions
- Built-in integrations
Builder
1,800 credits + 25,000 integration credits / month
- Everything in Pro
- Import projects
- Workflows
- Revert message
- Code editing
- Edit files & folders (create, rename, delete)
Premium
2,700 credits + 37,500 integration credits / month
- Everything in Builder
- Security check
- Convert a site to an Android / iOS app
- Priority support
Custom
4,500 to 12,200 credits + 59,500 to 164,500 integration credits / month
- Everything in Premium
- Pick the amount of credits you need
| Custom option | Price / month | Credits | Integration credits |
|---|---|---|---|
| 1 | $119 | 4,500 | 59,500 |
| 2 | $149 | 5,600 | 74,500 |
| 3 | $179 | 6,700 | 89,500 |
| 4 | $209 | 7,800 | 104,500 |
| 5 | $239 | 8,900 | 119,500 |
| 6 | $269 | 10,000 | 134,500 |
| 7 | $299 | 11,100 | 149,500 |
| 8 | $329 | 12,200 | 164,500 |
Yearly billing. The prices above are for monthly billing. On yearly billing each plan costs less per month and is charged once a year:
| Plan | Price / month | Charged once a year |
|---|---|---|
| Pro | $20 | $240 |
| Builder | $40 | $480 |
| Premium | $60 | $720 |
| Custom 1 | $100 | $1,200 |
| Custom 2 | $125 | $1,500 |
| Custom 3 | $150 | $1,800 |
| Custom 4 | $175 | $2,100 |
| Custom 5 | $200 | $2,400 |
| Custom 6 | $225 | $2,700 |
| Custom 7 | $250 | $3,000 |
| Custom 8 | $275 | $3,300 |
Credits and integration credits are the same on both, and they refresh every month on yearly billing too.
Payment flows
| Action | What you pay | When it takes effect |
|---|---|---|
| Subscribe (Free → paid plan) | The full first period, charged right away: one month on monthly billing, 12 months on yearly billing. | Immediately. Your charge day is the day you subscribed (the 28th if you subscribe on the 29th to the 31st). |
| Upgrade (to a more expensive plan) | Only the price difference between the plans, charged once. | Immediately. Your charge day stays the same, and the next charge is at the new price. |
| Downgrade (to a cheaper paid plan) | Nothing extra. The next charge is at the lower price. | You keep your current plan until the next payment succeeds, then switch. |
| Monthly → yearly | The yearly amount minus the month you already paid, charged once. If the yearly amount is lower than your current monthly charge, nothing is charged now. | Immediately, and the year counts from the start of your current month. If nothing was charged, the yearly plan starts at your next payment. |
| Yearly → monthly | Nothing now. The first monthly charge is when the paid year ends. | You keep your current plan until the paid year ends, then switch. |
| Cancel (move to Free) | No further charges. | At the end of the current billing cycle. Until then you can undo it with one click. |
A scheduled downgrade or cancellation can be undone any time before it takes effect. If a renewal payment fails, the account moves to the Free plan.
Credits breakdown
There are two kinds of credits:
- Credits are used when you build with Nabula's AI (chat requests, new sites, logos, security checks, imports, mobile apps).
- Integration credits are used by the sites you build when they run built-in integrations: backend function calls, workflow runs, file uploads, built-in email, built-in AI and realtime.
Both refresh once a month on your own billing cycle, not on the 1st of the calendar month. On a paid plan they refresh every month on your charge day of the month, on yearly billing too. On the Free plan, and on a plan without a monthly payment, they refresh on the day of the month you signed up. In a shorter month they refresh on its last day. The exact date of your next refresh is shown on the Subscription page. Unused credits don't roll over.
Credits have no fixed prices. Each AI action is charged by its real AI usage: the AI model it ran on and how much work it needed (how much the AI read and wrote). A small edit on a light model can use a fraction of a credit, and a large build on the most advanced model uses more. This applies to new sites, chat requests, Plan mode, security checks, project imports, AI logos and Android / iOS conversions.
- A request is charged once, for everything the AI did for it, even when it runs in several parts.
- Credits are counted with up to 2 decimals, for example 2.48 credits.
- Credits are charged while the request runs, so closing the editor doesn't change what a request costs.
- If you stop a request, you pay only for the work done until then. If you run out of credits in the middle of a request, it keeps working and can use up to 10 credits more than you have. After that it stops, and the changes made so far are kept. Those extra credits are not taken from your next month's credits or from the credits you get when you upgrade.
- You need at least 1 credit left to start an AI action.
- When a request is done, a three-dot button under the AI's last message shows how many credits it was charged. You can send the next message once that charge is recorded.
Integration credits have fixed prices, except built-in AI. Built-in AI text, images and video are charged by their real AI usage, the same way credits are: a short question costs less than a long conversation, and a longer video costs more. Integration credits are counted with up to 2 decimals.
| Action | Cost |
|---|---|
| File upload | 1 integration credit |
| Backend function call | 5 integration credits |
| Workflow run (all its steps included) | 5 integration credits |
| Built-in email, per recipient | 5 integration credits |
| Realtime connection, per visitor per 10 minutes | 1 integration credit |
| Realtime message, per recipient | 0.01 integration credits |
| Built-in AI request | By AI usage |
| Built-in AI image | By AI usage |
| Built-in AI video | By AI usage |
Your remaining credits and a day-by-day usage table are on the Subscription page.
Moving to Free
The Free plan has no limit on the number of projects, so all your projects stay open and editable. Nothing is deleted.
Custom domains are not part of the Free plan. When an account moves to Free, its sites that were live on a custom domain are unpublished, but the domains stay connected and verified. You can publish those sites again on a Nabula subdomain. After you upgrade again, press Publish and the site returns to its own domain, with nothing to connect or verify again.
Powerful features with no setup
Built-in integrations are available on the Pro plan and above. They run on Nabula's servers, so your site can use them without API keys of its own. Each use costs integration credits from the site owner's monthly allowance.
Built-in AI
Give your site its own AI features. Ask Nabula's builder AI something like "add a chatbot that answers questions about my menu" or "let users generate a product image".
- AI text: chatbots, summaries, writing help, classification, smart search.
- AI images: generate images from a description.
- AI video: generate short videos.
Built-in AI has no fixed price. Each request is charged in integration credits by its real AI usage. An estimate is reserved when a request starts and replaced by the real cost when it ends. If the request fails, the reserved credits are returned.
Built-in email
Send real emails from your site: order and booking confirmations, receipts, welcome messages, password codes, and notifications to you when a visitor submits a form. Ask Nabula's builder AI something like "send an order confirmation email when a customer buys" or "email me whenever the contact form is submitted", and it is wired up for you.
- Sender: every email is sent from
noreply@nabula.app, and the sender name is your site's name automatically. Change your site's name and the sender name changes with it. - Who you control: the recipient, subject and content are set by your site's own code.
- Server only: emails can only be sent from your site's backend, never from the page in a visitor's browser. That keeps the service safe and makes sure emails are never used by anyone outside your site.
- To any address: send to your own users, to addresses stored in your site's data, or to your own inbox.
- Price: 5 integration credits per recipient, taken from the site owner's monthly integration credits. If an email can't be sent, the credits are returned.
Backend functions
Backend functions are server code that your site runs securely: calling outside APIs, processing payments, sending data to other services, or running logic that must stay hidden from the browser. The AI writes them for you. Each call from your site costs 5 integration credits.
Secrets
API keys for outside services are stored as secrets in Settings → Backend secrets. They're encrypted with strong per-secret encryption, are only available to backend functions, and never reach the browser. When the AI builds something that needs a key, it tells you which secret to add.
Ready-made building blocks
The Library collects everything you can add to a site without building it from scratch. It has three categories.
Built-in Integrations
Services that run on Nabula's servers, so your site needs no API keys of its own. You add them by asking in the chat.
- Built-in AI: AI chat assistants, text generation, image generation and video generation, with models from Claude, ChatGPT and Gemini.
- Built-in Email Sending: transactional emails, welcome and follow-up emails, and automated notifications, sent from
noreply@nabula.appwith your site's name. - Built-in Auth & Database: sign up and login, protected pages, a database and file storage, all managed from the editor.
How each one works and what it costs is explained in Built-in integrations.
Skills
Ready-made prompts that teach the AI a complete, tested way to build something. Copy a skill and paste it into the chat of any of your projects.
Shortcut: type / in the chat box of a project or on the dashboard, and pick a skill from the list. Its name is added to your message in blue, for example "upgrade my landing page with /3D web-design", and the full skill is sent to the AI together with your message. Only a skill picked from the list counts (blue means it is on). Typing its name by hand does nothing.
- Recurring payments flow: a full subscription billing flow with subscribe, upgrade, downgrade, cancel and failed renewals.
- Regular payments flow: a secure one-time payment flow with success and failure handling, refunds, verification and duplicate prevention.
- Application Accessibility: improves your app's accessibility in line with international accessibility standards.
- Application Security: hardens the whole app against common vulnerabilities using OWASP best practices.
- 3D web-design: immersive 3D experiences with Three.js, interactive elements, lighting and smooth animations.
External Integrations
Copy-paste prompts that connect your site to an outside service using your own account with that service. The AI builds the backend for it, and your keys are stored as secrets.
- Tranzila recurring payment: recurring credit card payments (subscriptions and auto-pay) with the Tranzila iFrame and standing orders.
- Tranzila regular payment: one-time credit card payments (checkout, installments, Bit, PayPal, Google Pay) with the Tranzila iFrame.
Missing something? You can suggest a new integration or skill from the Library page.
The Nabula SDK
Every project includes the Nabula SDK, which connects your site to its database, users, files and backend. It's added automatically when the site builds, so it isn't part of your project files and you can't edit it. This reference is for people who edit their project's code by hand.
Importing
import { vibe } from '@/lib/vibe';
Always use exactly this import, from any file. Don't create a file at that path yourself.
vibe.auth: site users
Each project has its own user accounts, separate from your Nabula account.
await vibe.auth.signUp({ email, password, full_name }) // or { username, password, full_name }; password 8+ characters
await vibe.auth.signIn({ login, password }) // login = email or username
await vibe.auth.signOut() // this device: ends the session on the server and clears it in the browser
await vibe.auth.signOut({ scope: 'others' }) // every OTHER device; stays signed in here
await vibe.auth.signOut({ scope: 'global' }) // everywhere, including here
const sessions = await vibe.auth.listSessions() // [{ id, device, current, signed_in_at, last_active_at, expires_at }]
await vibe.auth.revokeSession(sessions[1].id) // ends one sign-in; the current one signs out here too
const user = await vibe.auth.getUser() // the restored user or null, waits for the session restore (no extra request)
const user = await vibe.auth.me() // fresh from the server: { id, email, username, full_name, role, ...profile }
const session = await vibe.auth.getSession() // { user, expires_at } or null (the token itself is never exposed)
await vibe.auth.updateMe({ full_name, phone }) // profile fields; email and role can't be changed here
const off = vibe.auth.onAuthStateChange((event, user) => { ... })
// event: 'INITIAL_SESSION' | 'SIGNED_IN' | 'SIGNED_OUT' | 'TOKEN_REFRESHED' | 'USER_UPDATED'
const off2 = vibe.auth.onChange((user) => { ... }) // older form: runs on sign in, sign out and profile updates
await vibe.auth.signInWithGoogle('/account') // only when Google sign-in is turned on in the Auth tab
// Forgot password: emails a one-time link to /reset-password?vibe_reset=… (valid 30 minutes)
await vibe.auth.requestPasswordReset({ email, path: '/reset-password' })
// On the /reset-password page:
if (!vibe.auth.resetToken()) { /* show "this link is invalid" */ }
const user = await vibe.auth.resetPassword({ password }) // signs the user in, signs out other devices
await vibe.auth.changePassword({ currentPassword, newPassword }) // ends EVERY session (all devices); this browser continues with a new one
await vibe.auth.deleteAccount({ password }) // permanent: the account and every record it owns; Google-only accounts: { confirm: true }
Staying signed in (session persistence)
Built in and on by default. You don't need to write any session code:
- Persist session: after signing in, the session is saved in the browser, so visitors stay signed in after a refresh and after closing and reopening the browser.
- Restore session: the SDK restores the session as soon as the site loads.
getUser()waits for this, so route guards and the first render never show a signed-out screen by mistake. - Auto refresh: while the site is used, the session token is replaced with a new one about once a day and gets a fresh 30-day expiry. Only one open tab refreshes at a time, and the server accepts exactly one refresh per token (other tabs simply pick up the new token), so open tabs are never signed out by accident. The old token keeps working for 2 minutes, then stops. If an already-replaced token is used again later, it was copied, and that sign-in is ended on every device.
- Session expiration: a session that isn't used for 30 days expires. Expired or revoked sessions (for example after a password change on another device, or when you sign a user out in the Auth tab) are cleared automatically and
onAuthStateChangereportsSIGNED_OUT. - Auth state listener:
onAuthStateChangekeeps your UI in sync, including other open tabs of the same site. - Sign out:
signOut()deletes the session on the server and removes it from the browser. Visitors can also sign out of all other devices, or see their active sign-ins and end any of them. - Password change: ends every session of the account on all devices; the device that changed it continues with a brand-new session.
Security: session tokens are 256-bit values from a cryptographically secure random generator; the server stores only their hash and never writes tokens to logs. Every session is bound to a device key that the SDK creates in the visitor's browser as non-extractable: no script, including one injected into the page, can read or copy it. Each request is signed with it, so a token copied out of the browser does not work anywhere else. If the browser can't keep the key, the session stays in memory only and nothing is written to storage. A script running on your page can still act while the page is open, so never add untrusted scripts or render unescaped user HTML.
Permissions: getUser() and me() are for the UI only. Every permission is checked on the server (entity permissions, and the verified user in backend functions); a user id or role sent by the browser is never trusted.
The reset email is sent from noreply@nabula.app with your site's name and costs no credits. For privacy, requestPasswordReset answers the same way whether or not the email has an account.
vibe.entities: data
Use the entities defined in your project's Data tab. Access rules for each entity are checked on the server.
const { items, next_cursor } = await vibe.entities.Order.list({ where: { status: 'open' }, sort: '-created_date', limit: 50, cursor })
const order = await vibe.entities.Order.get(id)
const slim = await vibe.entities.Order.list({ fields: ['title', 'price'] }) // only these fields (+ id) are returned
const created = await vibe.entities.Order.create({ ... }) // owner_id is set to the signed-in user
const updated = await vibe.entities.Order.update(id, { status: 'paid' }) // partial update
await vibe.entities.Order.delete(id)
Records look like { id, ...fields, owner_id, created_date, updated_date }. where matches fields exactly. Sort with 'field' or '-field'.
vibe.storage: files Pro and above
Upload and manage files for your site. Each successful upload costs 1 integration credit, and each data extraction costs 5. If the site owner has run out of integration credits, the SDK shows a message and the call fails. Allowed file types match the types you can attach in the AI chat: images, PDF, documents, 3D (glb, gltf), audio (mp3, m4a), video (mp4, webm, mov, gif), design files (psd, ai, eps) data files (csv, xlsx, xls, json, xml, yaml, md, sql, txt, html, zip) and code files (js, jsx, ts, jsonc). Files can be up to 10MB, or 50MB for media, 3D and design files.
// Public file: a permanent link anyone can open. Save file_url in a record.
const { file_url } = await vibe.storage.uploadFile({ file })
// Private file: returns a file_uri, which can't be opened directly.
const { file_uri } = await vibe.storage.uploadPrivateFile({ file })
// Temporary link to a private file (expires_in in seconds, default 300).
const { signed_url } = await vibe.storage.createFileSignedUrl({ file_uri, expires_in: 3600 })
// Pull structured data out of an uploaded CSV, Excel, JSON, HTML, PDF or image (PNG, JPG).
const result = await vibe.storage.extractDataFromUploadedFile({
file_url, // or file_uri
json_schema: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, email: { type: 'string' } } } }
}) // { status: 'success', output }
// Remove a file from the project's storage.
await vibe.storage.deleteFile({ file_url }) // or { file_uri }
file is a browser
File, for example from
<input type="file">. PascalCase names such as
vibe.storage.UploadFile and
vibe.storage.CreateFileSignedUrl also work. A private file can only be opened or deleted by the visitor who uploaded it, by the site's admins, or by your backend functions. A site can only sign, read or delete files it uploaded itself. After you delete a file, the site can no longer sign, read or manage it. A public file is permanent, so anyone who already saved its link may still be able to open it.
vibe.functions: your backend Pro and above
const data = await vibe.functions.invoke('orders/create', { productId }) // POST /api/orders/create
const list = await vibe.functions.invoke('orders/list', null, { query: { page: 2 } }) // GET
// options: { method, query, headers }
The visitor's session is sent automatically. Each call costs 5 integration credits.
vibe.realtime: live updates Pro and above
Realtime is built in: chat, live notifications, "who is online", collaboration, live dashboards and turn-based or casual multiplayer games. There is no outside service to set up and no API keys. Just ask the AI, for example "add a live chat room".
How it works: a visitor's browser only listens. Everything that is sent goes through the Nabula server, which checks who is sending, their permissions, the size and the rate, and then delivers it. So the sender of a message can be trusted, and a visitor can never listen to a channel or a record they are not allowed to read. A message usually arrives in 0.2 to 0.6 seconds.
Live entity changes
const off = vibe.entities.Message.subscribe(({ type, record, id }) => { ... }, { events: ['INSERT'], where: { room_id } })
// type: 'INSERT' | 'UPDATE' | 'DELETE'. Same as vibe.realtime.onEntity('Message', cb, opts)
await off.ready // listening has started (rejects if the visitor may not read the entity)
off() // stop listening
Changes made by anyone, from anywhere (other visitors, backend functions, the Data tab) arrive. The entity's read permission applies exactly as in list(): with owner, a visitor only receives changes of their own records, including updates and deletes. where is a filter in the browser for convenience, not security. For a live list, subscribe first, then load with list(), and merge by id.
Channels: messages and presence
const room = vibe.realtime.channel('chat:' + roomId, { access: 'users', maxMembers: 50 })
const { members, self } = await room.join({ state: { name: 'Dana' } })
room.on('message', (data, meta) => { ... }) // meta.from = { conn, user_id, user } verified by the server
const { id, recipients } = await room.send('message', { text }) // resolves only after delivery; throws on failure
await room.send('hint', data, { to: [userId] }) // only to some members
room.onPresence(({ type, member, members }) => { ... }) // 'sync' | 'join' | 'leave' | 'update'
await room.track({ typing: true }) // update this connection's presence state
room.onClose((reason) => { ... }) // 'closed' | 'removed' | 'error'
await room.leave()
vibe.realtime.onStatus((s) => { ... }) // 'connecting' | 'connected' | 'reconnecting' | 'disconnected'
- Access is set when a channel is first created:
public(anyone, including guests),users(signed-in visitors) orprivate(its creator, the listed member ids and site admins).send: 'server'makes a channel listen-only for visitors. The creator of a private channel caninvite(userId)andremove(userId). - Presence: leaving and closing the tab are reported at once. A connection that dies without notice (lost internet, crashed browser) disappears within about 2 minutes. One user with two tabs appears as two members.
- Reconnecting is automatic, including re-joining and renewing permissions. Messages sent while a visitor was disconnected are not replayed.
- Messages are not stored. Anything that must survive a refresh (chat history, scores, game state) belongs in an entity.
- Limits: 16,000 characters of JSON per message, 300 sends per minute per connection, 10 channels and 10 entity subscriptions per connection, up to 200 members per channel, and 100 connections per site at the same time.
- Not for fast-action games. Games that need many position updates every second (shooters, racing, real-time physics) are not supported yet. Turn-based, card, board, quiz and drawing games work well.
- Price: 1 integration credit per connected visitor per 10 minutes, and 0.01 integration credits per delivered message, per recipient (entity changes and presence updates count as messages). Both are counted on the server.
From backend functions
For anything a visitor must not be able to fake (game moves, scores, moderation), the browser calls a backend function, the function checks and saves, then broadcasts the result. These messages arrive with from = { server: true }.
import { nabula } from "@nabula/functions-sdk";
await nabula.realtime.broadcast("game:" + id, "state", { board, turn }) // optional: { to: [userId] }
await nabula.realtime.createChannel("game:" + id, { access: "private", members: [a, b], maxMembers: 2, send: "server" })
await nabula.realtime.members("game:" + id)
await nabula.realtime.addMember(name, userId) / removeMember(name, userId)
await nabula.realtime.deleteChannel(name) // closes it for everyone
Server SDK (backend functions)
All server code lives in the nabula/ folder. Endpoints are TypeScript files under nabula/functions/, one per file: nabula/functions/orders/create.ts becomes /api/orders/create. Logic used by several endpoints can go in nabula/shared/: server-only modules that are never endpoints and never reach the browser. Import them with the @shared/ alias.
// nabula/shared/pricing.ts
export function orderTotal(items: { price: number; qty: number }[]) {
return items.reduce((sum, i) => sum + i.price * i.qty, 0);
}
// nabula/functions/orders/create.ts
import { orderTotal } from "@shared/pricing.ts";
import { defineFunction, errors, nabula } from "@nabula/functions-sdk";
export default defineFunction({
methods: ["POST"],
auth: "required", // "required" | "optional" | "public"
async handler({ request, user, auth, db, secrets, json, text, query }) {
const body = await json();
if (!body.name) throw errors.badRequest("name is required");
const created = await db.from("Order").insert({ name: body.name });
const recent = await db.from("Order").select("title,status").eq("owner_id", user!.id).order("created_date", { ascending: false }).limit(20);
return Response.json({ created, recent: recent.items });
},
});
db.from(Entity):.eq() .order() .limit() .cursor(), then.get(id) .insert() .update(id, data) .delete(id). Access rules apply as the signed-in visitor.db.asServiceRole.from(Entity): skips access rules. Use it only after your own checks, for example in admin features or webhooks.auth.requireRole(request, "admin"): allows only site admins.secrets.get("NAME")/secrets.require("NAME"): values you add in Settings → Backend secrets.nabula.ai.chat / nabula.ai.image / nabula.ai.videoandnabula.email.send: built-in AI and email (see Built-in integrations).webhooks.verifyStripe / verifyHmac / checkTimestamp / once: verify incoming webhooks and process each event only once.
Access rules and asServiceRole
Each data table has four rules (read, create, update, delete), set in the Data tab. Each rule is one of: public (anyone, even guests), users (any signed-in visitor), owner (only the visitor who created the record), admin (site admins only). The rules are enforced on the Nabula server for every request, from the browser or a backend function, so they can't be bypassed by changing code in the browser.
- Read = owner: lists return only the visitor's own records, and opening someone else's record returns 404. Filtering by another user's
owner_idreturns nothing. - Update/Delete = owner: changing someone else's record returns 403.
- Site admins pass every rule. The project owner's email is always a site admin; everyone else signs up as
user. You can promote other users in the Data tab. - Guests get 401 on anything that isn't
public.
db.asServiceRole.from(Entity) (same as
db.service().from(Entity)) runs with full access and skips the rules. It works only inside your backend functions: the call is signed with a server key that exists only in your project's backend and never reaches the browser. A request with a missing or wrong key is rejected with 401. Use it only after checking the user yourself:
export default defineFunction({
methods: ["POST"],
auth: "required",
async handler({ request, auth, db }) {
await auth.requireRole(request, "admin"); // your own check first
const all = await db.asServiceRole.from("Order").limit(100); // every user's orders
return Response.json({ count: all.items.length });
},
});
Never return asServiceRole results to a visitor without filtering them, because they include other users' data.
Workflows: automations Builder and above
A workflow does something automatically in the background when an event happens or at a set time. You don't have to set it up yourself: describe what you want in the chat ("email me when a new order arrives") and the AI builds the server function and the workflow. You can also create and edit workflows by hand in the project's Workflows tab, where you can see each workflow's status and the full history of its runs.
Cost: each run uses 5 integration credits, charged once when the run starts, from the site owner's monthly integration credits. That covers the whole run: its waits, conditions, retries and the server functions it calls (those calls are not charged again). Built-in AI or email used inside those functions is charged at its normal price. A run is never charged twice, even if it is retried or resumed. If the run can't reach the site's backend at all, its 5 credits are returned. If you don't have enough credits left, the run doesn't start and fails with a clear message.
Triggers (what starts a workflow)
- New record: a record is created in a table, e.g. a new order or contact message.
- Record updated: a record changes, optionally only when certain fields change (e.g.
status), with extra conditions. - Sign up / log in: a visitor creates an account or signs in.
- Webhook: an outside service (Stripe, GitHub, Zapier, a form tool…) sends a POST request to the workflow's secret URL. Send an
Idempotency-KeyorX-Event-Idheader so each event runs only once. Limit: 60 calls per minute and 100 KB per request. - Schedule: a repeating schedule (cron, in your own time zone, daylight saving handled), every N minutes/hours/days (at least 5 minutes), or a single date and time. Runs can start up to 5 minutes late.
Steps (what it does)
- Run a server function from
nabula/functions/, with arguments. Failed calls are retried automatically (up to 5 times, with growing delays). - Wait: from 1 second up to 30 days. Long waits are saved on the server, so they continue even if nobody has the site open.
- If / Else: continue, stop or jump to another step depending on conditions.
Steps run in order. Argument values can use the event's data, e.g. {{trigger.record.email}}, {{trigger.user.id}}, {{trigger.body.amount}}, or the result of an earlier step, {{steps.notify.output.id}}.
Ideas
- Email the shop owner on every new order, and email the customer when the order's status becomes "shipped".
- Welcome new users, then send them a tips email 3 days later (wait step).
- Every morning at 08:00, send a summary of yesterday's sign-ups and sales.
- Receive payment webhooks and mark orders as paid.
- Every hour, clean up expired bookings or sync prices from an external API.
Writing a function for a workflow
// nabula/functions/orders/notify.ts
import { defineFunction, errors, nabula } from "@nabula/functions-sdk";
export default defineFunction({
methods: ["POST"],
async handler({ workflow, json, db }) {
if (!workflow) throw errors.forbidden(); // only the workflow engine may call it
const { orderId } = await json(); // the step's arguments
const order = await db.asServiceRole.from("Order").get(orderId);
await nabula.email.send({ to: "owner@example.com", subject: "New order", html: `Order ${order.id}` });
return Response.json({ sent: true });
},
});
- When the workflow engine calls a function,
workflowis set to{ runId, stepId }, there is no signed-in user, and theIdempotency-Keyheader is the same on every retry of that step. - Workflows run whether or not the site is published. On a published site they call the published backend, so publish again after changing a function a workflow uses. On a site that isn't published they call the preview's backend, or your saved backend code when the preview is asleep.
- Each workflow belongs to one project and can only use that project's tables and functions; this is checked whenever a workflow is saved or turned on. A project can have up to 20 workflows with up to 20 steps each, and up to 3 runs at the same time.
External API
To reach a project's data or backend functions from outside Nabula (your own server, a script, an automation tool), use the project's external API. Open Advanced → API in the editor to see the project's app_id and app_api_key, the fields of each entity and the exact endpoints. Both values are required on every request, in the X-App-Id and X-Api-Key headers.
GET /functions/siteApi?entity=Order // list (optional: where, sort, limit, cursor, fields)
GET /functions/siteApi?entity=Order&id={id} // one record
POST /functions/siteApi?entity=Order // create, JSON body
PUT /functions/siteApi?entity=Order&id={id} // partial update, JSON body
DELETE /functions/siteApi?entity=Order&id={id}
POST /functions/siteApi?function=orders/create // a backend function, 5 integration credits per call
- Permissions: the API key never bypasses entity permissions. A request with the key runs as a guest, so only operations whose rule is
publicwork, and backend functions withauth: "required"answer 401. - Keep the key secret: use it only from a server. It is never part of your site's code or of a project copied from the Community, and each project has its own key. Regenerate API Key cancels the old key immediately.
- Limits: 300 requests a minute per API key (120 of them writes) and 10,000 requests an hour per project. Above that the API answers
429 Too Many Requestswith aRetry-Afterheader.
Errors
Failed calls throw an Error with a .status: 400 invalid input, 401 sign-in required, 402 not enough integration credits, 403 not allowed, 404 not found, 413 file too large. Always show loading and error states in your UI.
Tools that make building faster
Nabula's editor gives you more than a chat. Here's what each tool does, what it's good for, and what it costs.
Visual edits Pro and above Free, no credits
Click any element in the live preview and change it directly: text, colors and sizes. Nabula finds the exact place in your code and updates it instantly. It's the fastest way to polish wording and styling without writing a prompt, and it doesn't use credits.
Plan mode All plans Charged by AI usage
Switch the chat from Build to Plan to talk with the AI about your project without changing anything. Ask it to explain how something works, plan a feature, compare approaches or review your site. The AI can read your project but can't edit it. A Plan request is charged by its AI usage, and usually uses fewer credits than a build request because the AI writes no code.
Revert message Builder and above Free, no credits
Before each AI request changes your project, Nabula saves a snapshot. If you don't like the result, click Revert on that message and your files return to exactly how they were before it. Try bold ideas without fear. Reverting doesn't use credits.
Convert a site to an Android / iOS app Premium & Custom Charged by AI usage
Turn your site into a real mobile app with one click.
- Android: Nabula builds a ready-to-install APK of your site, with your logo as the app icon.
- iOS: Nabula creates a complete Xcode project you can open on a Mac and submit to the App Store.
- Step-by-step guides in the editor explain how to publish to Google Play and the App Store.
Your site must be published first, because the app loads your live site: it opens the address the site is live on, your own domain or its Nabula subdomain. If you later move the site to another address, create the app again. Each conversion is charged by its AI usage.
Choose the AI model Pro and above
Free plans use Nabula's default model, which is fast and capable. On paid plans you can pick a specific model, from light and low-cost models for small changes to the most advanced ones for complex work. Credits follow the model's real cost, so the same request uses fewer credits on a lighter model and more on an advanced one (see the credits breakdown). You can also give the AI standing instructions for the project, such as tone, brand rules or tech preferences.
Thinking Pro and above
Next to the model button there is a Thinking button with three levels: Low (the default), Medium and High. It sets how much the AI reasons before it answers, and works the same with every model. A higher level suits complex requests, takes longer and uses more credits, because the thinking is part of the request's real AI usage. Your choice is saved for the project until you change it. On the Free plan the AI always works with Low.
Code editing Builder and above Free, no credits
Open the Code tab to see and edit every file of your project in a full code editor. You can also create files and folders. The AI notices your changes and works with them on your next request.
SEO tools Pro and above
Turn robots.txt, sitemap.xml and llms.txt (a short description of your site and its pages for AI assistants) on or off; all three are on by default and kept up to date on every build. These files, and the project logo, are managed by Nabula and can't be edited or deleted in the Code tab.
Set the site description (used by search engines for your whole site) and per-page meta tags, including social sharing tags, from Settings → SEO, so search engines and social networks show your site correctly.
Each screen has its own card with a switch, on by default. Turn it off to leave that screen without meta tags: its saved tags are kept but not added to the page, and the AI can't set them. Only you can change the switch.
More tools
- Attachments: attach images or files to a chat message (for example a design you like) and the AI builds from them.
- AI logo: generate a logo for your project (charged by AI usage).
- Download as ZIP: download the full source code of your project anytime, on every plan.
- Community: share a published site publicly, and let others copy it as a template if you choose. Only sites that are live (on a Nabula subdomain or a custom domain) can be shared, and a shared site is shown in the Community while it is live. Clicking it opens the live site.
- Logs: see errors from your site's preview and backend, so you or the AI can fix them fast.
- Remove the Nabula badge from your published site on Pro and above.
Nabula