Docs / Apps
Apps
An app is a small web page with its own address. People in your organisation sign in with their OAIZ account and work with the databases and workflows the app is allowed to use.
Workflows run on their own. Build an app when a person needs to look at something and decide, or when a database table needs a screen of its own. For example, a page lists open refund requests from a database, and a team member approves one with a button. The approval changes the row, and a live workflow that listens for that change sends the reply.
Each app starts from the OAIZ app starter, a React and TypeScript project that signs people in with OAIZ. You change it by asking Chat, or a developer edits its files with the CLI. Apps are available when the feature is enabled for your organisation.
Building an app in Chat
Choose New, then App, in the Library and give the app a name of up to 100 characters. The app opens on its own page with Chat beside a live preview. Chat can also create an app from a request in any chat, and the new app joins that chat’s context.
“Show the open rows of the refund requests table, newest first, with an Approve button that sets the status to approved.”
Chat edits the app’s files. Its first change makes a draft from the live version. At the end of each turn, Chat saves every changed file as one version of the draft, and its message names the version. Undo this turn brings back the version from before the turn. Chat never publishes.
While a draft is open, the preview runs it and shows each start-up step, such as Installing dependencies. Screen size switches the preview between Desktop and Phone. If a change cannot be shown, the canvas says so and keeps the last version that worked. Ask Chat for the change again.
Drafts, publishing and versions
- Live
- The published version, served at the app’s address. The starter is a new app’s first live version once it is ready, and until then the app shows Not live yet. People with Can use see only this version.
- Draft
- A separate branch for changes. It has its own preview address. Changes stay in the draft until you publish it, and only people with Can change see drafts.
- Version
- A saved set of the app’s files, numbered per branch. Every save from Chat or the CLI adds one, and earlier versions stay in the version list.
Publish needs Can change and a draft whose latest version has finished getting ready. The panel lists the changes since the draft started, the address, and who can use the app. Publishing merges the draft into the live version file by file and removes the draft. The address serves the new version within about 30 seconds of it being ready.
When someone published other changes to the same files since your draft started, the panel says so. Publish my draft anyway replaces their changes to those files.
To go back, pick an earlier version. On a draft, Restore to this draft saves it as the draft’s next version. On the live version, Restore as a new draft makes a draft with that version, which you then publish. Restoring changes the files only. Rows the app wrote stay as they are.
Address
OAIZ gives each app an address when it is created: its name in lower case with hyphens, up to 22 characters, followed by six random characters, under oaiz.app. You cannot choose or edit it. Renaming the app in Settings keeps the address. Copy address in Settings or in the Publish panel copies it.
The address answers any browser, and asks search engines not to index the page. The page has no data until someone signs in.
Who can use an app
The person who creates an app is its Owner. An Owner uses Share to give access to people, teams or everyone in the organisation. Apps have no public link, and nobody outside your organisation can sign in.
- Can use
- Sign in to the live app at its address and use it.
- Can change
- Also see and sign in to drafts, change the app in Chat, publish, restore versions and rename it.
- Owner
- Also share the app and delete it. An app always keeps at least one Owner.
Sign in with OAIZ checks two things: the person belongs to the app’s organisation, and holds Can use or more. Organisation Administrators can sign in to every app. Access control explains teams and organisation-wide grants.
Databases and workflows
An app works with its own access, not the access of the person using it. It reaches a database, workflow, knowledge document or integration only when that item is shared with the app. A person’s own grants neither add to the app’s access nor are needed. An app receives View or Edit, never Owner.
Settings lists the app’s Databases. Add database offers the databases you own, each with Read only or Read and change. Only a database’s Owner can add or change this access. Other items are shared with an app through Change access in Chat or through the CLI. Saving the app’s code gives it no access.
- Rows
- Read the schema and select rows. Read and change also permits insert, update and delete. Row rules still apply, and each committed write produces a row event that workflow jobs can listen for.
- Workflow runs
- Start a job of a workflow shared with the app, follow its progress and read its runs. Other workflows look absent to the app.
- Events
- Publish an event, which starts the live jobs that listen for its type.
- Knowledge documents
- List and read shared documents.
In a workflow, the tab bar shows a tab for each database its jobs use and for each app with access to one of those databases. An app’s own page shows its databases as tabs in the same way.
Calling a model
An app’s code can ask a model for one answer with oaiz.llm.call. The call names a model, an optional system instruction and an input text, and returns the answer text, the model that answered and the input and output tokens the provider counted. Server code makes the same call with an API key. Calls carry no conversation, tools or files, and the answer arrives whole. A longer job belongs in a workflow the app starts.
Unlike the items above, a call from an app runs as the signed-in person, not with the app’s access. Its cost counts against that person’s spend limit and the organisation’s, and a call at either limit is refused with budget-exceeded. The model must be enabled for both Chat and Workflows in Enable Models, otherwise the call is refused with llm-model-not-permitted. A call that has no answer after five minutes ends without one. An input too large for the model is refused before any model sees it, with llm-call-context-length, and is never shortened.
Working on the files with the CLI
oaiz view keeps one branch of an app in a folder on your computer. Create a branch, pull it, edit the files and push them as the branch’s next version, then publish. Chat and the CLI work on the same branches, and Chat’s message names files changed by a command. oaiz view kit add copies ready parts such as a data table, a record form and a chat panel into the app as editable code.
oaiz view pull <viewId> --branch main
oaiz view branch create refunds
oaiz view pull --branch refunds
oaiz view kit add data-table oaiz-data
oaiz view push --message "Add the refund table"
oaiz view publish --yesApps build with npm, so a push needs package.json and a package-lock.json. A version holds at most 10,000 files, 25 MiB per file and 250 MiB in total.
Deleting an app
An Owner deletes an app from Settings. Its address stops working and it loses its database access. The databases and their data stay. The app waits in Recently deleted in the Library for 30 days, where you or an Administrator can restore it.