Search documentation

Search guides, connectors and tools

App functions

An app's pages run in the visitor's browser, which can only talk to the app's own address. Anything else, such as showing your newest emails, pulling an exchange rate from a public service or combining this week's calendar with your open tasks, needs a function: a small piece of server-side code the App Builder writes and the app calls while someone uses it.

Ask for what you need in plain language; the builder decides when a function is needed and writes it. Functions run on Tunori and can reach the internet and the tools of your integrations that you have granted to the app.

Granting tools

Before a function may use one of your integrations, the builder asks you to grant the app the specific tools it needs, for example Gmail's Search Emails. The approval card lists the integration and each tool.

Approving means that the app's code decides what those tools are called with, for everyone who can use the app. Grant only what the app needs, and think twice about tools that change data, such as sending an email or creating a document: they run for whoever uses the app.

The app's Integrations page lists the granted tools and lets you revoke them. When a function needs a tool that is not granted, the builder asks again. Deleting an integration removes its tools from every app.

Who can run functions

  • Every member who can open the app, viewers included. Granting a tool therefore shares what it returns with everyone in your organization who can use the app, like a dashboard does.
  • Anonymous visitors of a public app only if an admin allows it: on a public app, an admin chooses Allow anyone under Access on the app's Settings page (or Functions: members in the builder's header) and confirms. The setting then shows Functions: anyone. Anyone on the internet can then run each function, with any input, from any program, not only through the app's pages, and a function may use the granted tools for them as far as its code lets them. Turn it on only for apps whose functions you would publish on a web page. Making the app members-only again switches it back.

Visitors who may not run a function get a sign-in prompt where the app uses it.

Using your database

An app can store and read data in your organization's database, the same one your agents and the Database page work with. The builder asks for it when an app needs to keep data between visits; you approve the request in the chat, choosing between Read (the app shows data) and Read and write (the app also adds, changes or deletes rows). The setting is also on the app's Database page. An editor can allow it; once anyone on the internet may run the app's functions, only an admin can change it.

A few things to know:

  • The access applies to everyone who can run the app's functions. On a public app whose functions anyone may run, that is everyone on the internet.
  • The app can never change tables or columns. The builder creates the tables the app needs in the builder chat, with your approval, like on the Database page.
  • The app's preview and the published app use the same database, so rows written while trying the app out are real rows.
  • Every statement an app runs appears in the Database page's activity log, with the app's name.

Files

Every app has a file storage of its own: files kept outside the app's code and outside any version, shared by the app's preview and its published version. Functions can create, read, replace and delete files there, and editors see, upload, download and delete them on the app's Files page. It is the place for a photo gallery, a large video, a price list to download, or a report a function generates on request.

  • Files in the storage's public folder are served by the app to whoever can open it: anyone for a public app, signed-in members otherwise. Everything else is private: only the app's functions can read it. The builder knows the rule and puts files where they belong.
  • Images, audio, video, PDF and plain text open in the browser; other kinds are offered as a download. HTML is never displayed from the storage.
  • Limits: 25 MB per file, 1 GB and 10,000 files per app. Functions may make 20 file operations per run.
  • Whoever can run the app's functions can make them write files, anonymous visitors of a public app included where an admin allowed that; the platform caps how much they can write per day.
  • The preview and the published app share the storage, so a file written while trying the app out is a real file of the app.

Small images the app's pages show, such as a logo, usually live in the app's code instead: attach the image to the builder chat and ask for it to be used, and the builder puts it into the app.

Costs and records

Running a function costs nothing by itself, and neither does what it does in your database. Each tool call a function makes is charged like a tool call in a chat, under your organization's connected account (for Gmail, the mailbox you connected). See billing and credits.

Every function run and every tool call is recorded, with what was called, with which input and by whom (anonymous visitors by IP address). The records are kept for 90 days.

Secrets

Functions cannot keep secrets: there is no way yet to give an app an API key of its own. Public services that need no key work. A credential written into an app is caught when the app is built; see versions and publishing.