{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "Pawabase Blog",
  "home_page_url": "https://pawabase.com/blog",
  "feed_url": "https://pawabase.com/blog/feed.json",
  "description": "Product updates, engineering notes and guides from the people building Pawabase.",
  "icon": "https://pawabase.com/icon-512.png",
  "language": "en",
  "items": [
    {
      "id": "https://pawabase.com/blog/call-ai-models-without-exposing-your-keys",
      "url": "https://pawabase.com/blog/call-ai-models-without-exposing-your-keys",
      "title": "Call any AI model from your app without exposing your keys",
      "summary": "The Pawabase AI gateway gives your app one address for every model. Provider keys stay on the server, and your access rules decide who may call each one.",
      "content_html": "<p>Every week, someone finds an AI provider&#x27;s secret key in a public app. It&#x27;s in the JavaScript bundle of a weekend project, in the\nbuild of a mobile app, in a repository that was public for one afternoon. Scrapers look for these keys all day, and the first sign\nthat one was found is usually the bill.</p>\n<p>Nobody ships a key on purpose. It happens because calling a model straight from your app is the fastest way to build an AI feature,\nand the fastest way puts the key where the code runs. The safe way, a server in between, has always meant building, securing and\nrunning one more thing, usually on a deadline.</p>\n<p>Today we&#x27;re making the safe way the fast way. Every Pawabase environment now includes an <strong>AI gateway</strong>: one address for every model\nyou connect. The provider keys stay on the server, your access rules decide who may call each model, and every call is recorded with\nwho made it and what it cost.</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Without a gateway, the provider key ships inside your app to every visitor; with the Pawabase AI gateway, your app holds only a publishable key and the provider keys stay on the server\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 860;background-image:url(&quot;data:image/webp;base64,UklGRjwAAABXRUJQVlA4IDAAAACwAgCdASoYAA0APu1iqk2tJaQiMAgBoB2JZwAAeyAA/vCMbEpGurMe+lrS5sjgAAA=&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/keys-jH3wwPEU.avif 640w, https://pawabase.com/assets/keys-inF4k7IA.avif 960w, https://pawabase.com/assets/keys-DYhdkU2B.avif 1280w, https://pawabase.com/assets/keys-BfYCqVW1.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/keys-CPGrM8a-.webp 640w, https://pawabase.com/assets/keys-NNrUScx8.webp 960w, https://pawabase.com/assets/keys-TqavinxM.webp 1280w, https://pawabase.com/assets/keys-DxiAcNpz.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/keys-OYKvycoR.jpg 640w, https://pawabase.com/assets/keys-Gy0z2aFZ.jpg 960w, https://pawabase.com/assets/keys-D1W5HNdq.jpg 1280w, https://pawabase.com/assets/keys-CWjvnrGB.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/keys-CWjvnrGB.jpg\" width=\"1600\" height=\"860\" alt=\"Without a gateway, the provider key ships inside your app to every visitor; with the Pawabase AI gateway, your app holds only a publishable key and the provider keys stay on the server\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>The difference: a key anyone can read, or a key that never leaves the server.</figcaption></figure>\n<p>In this post we&#x27;ll show what the gateway is, then build a real feature with it: an AI-powered support inbox that summarises tickets,\ndrafts replies, finds similar past tickets and hands the hard ones to an agent, without one provider key on a user&#x27;s device.</p>\n<h2 id=\"the-proxy-everyone-ends-up-writing\">The proxy everyone ends up writing</h2>\n<p>Ask any team that has shipped an AI feature to real users, and they&#x27;ll describe the same piece of code. It starts as a small server\nendpoint that holds the key and forwards a prompt. Then it grows:</p>\n<ul>\n<li><strong>Authentication</strong>, because the endpoint is on the internet, and anyone who finds it can spend your money.</li>\n<li><strong>Rules</strong>, because free users should get the small model and only admins should get the expensive one.</li>\n<li><strong>Rate limits and logging</strong>, because one user with a loop can cost more than the rest of your customers combined, and you need to\nknow who it was.</li>\n<li><strong>Streaming</strong>, because nobody wants to stare at a spinner for twelve seconds while a model writes a paragraph.</li>\n<li><strong>A wrapper for each provider</strong>, because each API is slightly different, and switching from one to another means a rewrite.</li>\n<li><strong>Retries and fallbacks</strong>, because every provider has bad days, and &quot;the AI is down&quot; is a support ticket you can&#x27;t fix.</li>\n</ul>\n<p>That&#x27;s a week of work with nothing to do with your product, followed by years of maintenance. It&#x27;s also the code where a mistake\ncosts real money. The AI gateway is that whole proxy, built into the backend your app already uses.</p>\n<h2 id=\"meet-the-ai-gateway\">Meet the AI gateway</h2>\n<h3 id=\"connect-a-provider-once\">Connect a provider once</h3>\n<p>In Studio, open <strong>AI</strong> and connect a provider: <strong>OpenAI, Anthropic, Google Gemini, Mistral, Groq, xAI</strong>, or any service that speaks\nthe OpenAI API, including models you host yourself. You paste the provider&#x27;s key once. It&#x27;s stored on the server, and from then on it\nnever travels to a browser, a phone or a log.</p>\n<p>You keep your own account with each provider, so you pay them directly at their prices. Pawabase never marks up your tokens.</p>\n<h3 id=\"expose-models-under-your-own-names\">Expose models under your own names</h3>\n<p>Next, choose the models your app may use and give each one a name of your own: <code>chat</code> for your everyday assistant, <code>fast</code> for quick\nclassifications, <code>embed</code> for search. Your app calls the name, never the vendor&#x27;s model ID.</p>\n<p>This is the change that pays off for years. When a better or cheaper model comes out next month, you point <code>chat</code> at it in Studio and\nevery app you&#x27;ve shipped uses it on the next request. <strong>No code change, no deploy, no app-store review.</strong> You can move a name from one\nprovider to another the same way, because the gateway speaks one format to your app and translates for each provider behind it.</p>\n<p>Each name can also carry:</p>\n<ul>\n<li><strong>Instructions</strong>: a system prompt kept on the server. Your product&#x27;s voice and rules live in one place instead of being copied into\nevery client, and anyone reading your bundle can&#x27;t see them. When an app sends its own system message, that one is used instead.</li>\n<li><strong>A fallback</strong> (&quot;If it fails, try&quot;): another model to call when this one is rate limited, times out or has an outage. If <code>chat</code>\nis on one provider and its fallback is on another, a provider&#x27;s bad afternoon never reaches your users.</li>\n<li><strong>Prices</strong>: the model&#x27;s input and output prices, so Studio can show you what every call cost.</li>\n</ul>\n<h3 id=\"decide-who-may-call-each-model\">Decide who may call each model</h3>\n<p>Every model has a <strong>policy</strong>: who may use it. These are the same access rules that already protect your tables and files, so there&#x27;s\nnothing new to learn and nothing to keep in sync.</p>\n<p>By default, a new model can be called <strong>only from your servers</strong>. You open it up on purpose: to signed-in users, to members of an\norganization, to admins only, or to any rule you&#x27;ve written. The cheap <code>fast</code> model can be open to everyone signed in, while the large\n<code>reasoning</code> model is limited to your paid plan.</p>\n<p>When someone isn&#x27;t allowed, the gateway refuses before your provider is ever called. A signed-out visitor who tries a model that needs\nsign-in gets a clear <code>401</code> with &quot;sign in to use this model&quot;. A signed-in user without access gets a <code>403</code>. Either way, your provider\nnever sees the request, and you&#x27;re never billed for it.</p>\n<h3 id=\"call-it-from-your-app\">Call it from your app</h3>\n<p>Your app talks to the gateway with its ordinary <strong>publishable key</strong>, the same one it already uses for data and sign-in. That key is\nsafe to ship, because what it can do is decided by your rules, not by the key. The person&#x27;s sign-in session tells the gateway who is\nasking.</p>\n<div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">src/pawabase.ts</span><span class=\"bp-code-lang\">TypeScript</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> createClient </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">from</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;@pawabase/client&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">export</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> pawabase </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token function\" style=\"color:#ffd27a\">createClient</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\">  url</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">meta</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">env</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token constant\" style=\"color:#7fb2f0\">VITE_PAWABASE_URL</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\">  project</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">meta</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">env</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token constant\" style=\"color:#7fb2f0\">VITE_PAWABASE_PROJECT</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">6</span><span class=\"bp-lc\"><span class=\"token plain\">  apiKey</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">meta</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">env</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token constant\" style=\"color:#7fb2f0\">VITE_PAWABASE_KEY</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> </span><span class=\"token comment\" style=\"color:#77736c;font-style:italic\">// a publishable key: safe to ship</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">7</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span>\n</span></span></code></pre></div>\n<p>That&#x27;s the whole setup. Now let&#x27;s build something with it.</p>\n<h2 id=\"build-it-an-ai-support-inbox\">Build it: an AI support inbox</h2>\n<p>Imagine a helpdesk app with a <code>tickets</code> table. Agents (the human kind) read tickets, reply to customers and close them. We&#x27;ll add four\nthings, each in a few lines of code:</p>\n<div class=\"bp-steps\"><h3 id=\"summarise-a-ticket\">Summarise a ticket</h3><p>Long, angry, three-screen tickets are where support time goes. <code>ai.chat</code> takes a model name and a prompt and returns the answer as\ntext:</p><div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">src/inbox/summary.ts</span><span class=\"bp-code-lang\">TypeScript</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">export</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">async</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">function</span><span class=\"token plain\"> </span><span class=\"token function\" style=\"color:#ffd27a\">summarise</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">ticket</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> subject</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token builtin\" style=\"color:#ffb36b\">string</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"> body</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token builtin\" style=\"color:#ffb36b\">string</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">return</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">ai</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">chat</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;fast&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">[</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\">    </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> role</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;system&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> content</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;Summarise support tickets in two short sentences. Say what the customer wants.&quot;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\">    </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> role</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;user&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> content</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token template-string template-punctuation string\" style=\"color:#ffd27a\">`</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">${</span><span class=\"token template-string interpolation\" style=\"color:#ffd27a\">ticket</span><span class=\"token template-string interpolation punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token template-string interpolation\" style=\"color:#ffd27a\">subject</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token template-string string\" style=\"color:#ffd27a\">\\n\\n</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">${</span><span class=\"token template-string interpolation\" style=\"color:#ffd27a\">ticket</span><span class=\"token template-string interpolation punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token template-string interpolation\" style=\"color:#ffd27a\">body</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token template-string template-punctuation string\" style=\"color:#ffd27a\">`</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">]</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">6</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span>\n</span></span></code></pre></div><p><code>fast</code> is a small, cheap model that every signed-in support agent may use. If you&#x27;d rather keep the instructions off the client\nentirely, put them in the model&#x27;s <strong>Instructions</strong> in Studio and send only the ticket.</p><h3 id=\"draft-a-reply-word-by-word\">Draft a reply, word by word</h3><p>A drafted reply should appear as it&#x27;s written, the way people now expect AI to feel. <code>ai.stream</code> gives you the answer as an async\niterator of text pieces:</p><div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">src/inbox/DraftReply.tsx</span><span class=\"bp-code-lang\">TSX</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token plain\"> </span><span class=\"token imports punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token imports\"> useState </span><span class=\"token imports punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">from</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;react&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token plain\"> </span><span class=\"token imports punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token imports\"> pawabase </span><span class=\"token imports punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">from</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;../pawabase&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">export</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">function</span><span class=\"token plain\"> </span><span class=\"token function\" style=\"color:#ffd27a\">DraftReply</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> ticket </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> ticket</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token maybe-class-name\">Ticket</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">[</span><span class=\"token plain\">draft</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> setDraft</span><span class=\"token punctuation\" style=\"color:#a8a49d\">]</span><span class=\"token plain\"> </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token function\" style=\"color:#ffd27a\">useState</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">6</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">7</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">async</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">function</span><span class=\"token plain\"> </span><span class=\"token function\" style=\"color:#ffd27a\">write</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">8</span><span class=\"bp-lc\"><span class=\"token plain\">    </span><span class=\"token function\" style=\"color:#ffd27a\">setDraft</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">9</span><span class=\"bp-lc\"><span class=\"token plain\">    </span><span class=\"token keyword\" style=\"color:#FF6A00\">for</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> piece </span><span class=\"token keyword\" style=\"color:#FF6A00\">of</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token property-access\">ai</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token method function property-access\" style=\"color:#ffd27a\">stream</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;chat&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> </span><span class=\"token template-string template-punctuation string\" style=\"color:#ffd27a\">`</span><span class=\"token template-string string\" style=\"color:#ffd27a\">Write a kind, specific reply to this ticket:\\n\\n</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">${</span><span class=\"token template-string interpolation\" style=\"color:#ffd27a\">ticket</span><span class=\"token template-string interpolation punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token template-string interpolation\" style=\"color:#ffd27a\">body</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token template-string template-punctuation string\" style=\"color:#ffd27a\">`</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">10</span><span class=\"bp-lc\"><span class=\"token plain\">      </span><span class=\"token function\" style=\"color:#ffd27a\">setDraft</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">text</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token arrow operator\" style=\"color:#FF6A00\">=&gt;</span><span class=\"token plain\"> text </span><span class=\"token operator\" style=\"color:#FF6A00\">+</span><span class=\"token plain\"> piece</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">11</span><span class=\"bp-lc\"><span class=\"token plain\">    </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">12</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">13</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">14</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">return</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">15</span><span class=\"bp-lc\"><span class=\"token plain\">    </span><span class=\"token tag punctuation\" style=\"color:#a8a49d\">&lt;</span><span class=\"token tag punctuation\" style=\"color:#a8a49d\">&gt;</span><span class=\"token plain-text\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">16</span><span class=\"bp-lc\"><span class=\"token plain-text\">      </span><span class=\"token tag punctuation\" style=\"color:#a8a49d\">&lt;</span><span class=\"token tag\" style=\"color:#ffb36b\">button</span><span class=\"token tag\" style=\"color:#ffb36b\"> </span><span class=\"token tag attr-name\" style=\"color:#f3f0eb\">onClick</span><span class=\"token tag script language-javascript script-punctuation punctuation\" style=\"color:#a8a49d\">=</span><span class=\"token tag script language-javascript punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token tag script language-javascript\" style=\"color:#ffb36b\">write</span><span class=\"token tag script language-javascript punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token tag punctuation\" style=\"color:#a8a49d\">&gt;</span><span class=\"token plain-text\">Draft a reply</span><span class=\"token tag punctuation\" style=\"color:#a8a49d\">&lt;/</span><span class=\"token tag\" style=\"color:#ffb36b\">button</span><span class=\"token tag punctuation\" style=\"color:#a8a49d\">&gt;</span><span class=\"token plain-text\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">17</span><span class=\"bp-lc\"><span class=\"token plain-text\">      </span><span class=\"token tag punctuation\" style=\"color:#a8a49d\">&lt;</span><span class=\"token tag\" style=\"color:#ffb36b\">textarea</span><span class=\"token tag\" style=\"color:#ffb36b\"> </span><span class=\"token tag attr-name\" style=\"color:#f3f0eb\">value</span><span class=\"token tag script language-javascript script-punctuation punctuation\" style=\"color:#a8a49d\">=</span><span class=\"token tag script language-javascript punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token tag script language-javascript\" style=\"color:#ffb36b\">draft</span><span class=\"token tag script language-javascript punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token tag\" style=\"color:#ffb36b\"> </span><span class=\"token tag attr-name\" style=\"color:#f3f0eb\">onChange</span><span class=\"token tag script language-javascript script-punctuation punctuation\" style=\"color:#a8a49d\">=</span><span class=\"token tag script language-javascript punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token tag script language-javascript punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token tag script language-javascript\" style=\"color:#ffb36b\">e</span><span class=\"token tag script language-javascript punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token tag script language-javascript\" style=\"color:#ffb36b\"> </span><span class=\"token tag script language-javascript arrow operator\" style=\"color:#FF6A00\">=&gt;</span><span class=\"token tag script language-javascript\" style=\"color:#ffb36b\"> </span><span class=\"token tag script language-javascript function\" style=\"color:#ffd27a\">setDraft</span><span class=\"token tag script language-javascript punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token tag script language-javascript\" style=\"color:#ffb36b\">e</span><span class=\"token tag script language-javascript punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token tag script language-javascript property-access\" style=\"color:#ffb36b\">target</span><span class=\"token tag script language-javascript punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token tag script language-javascript property-access\" style=\"color:#ffb36b\">value</span><span class=\"token tag script language-javascript punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token tag script language-javascript punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token tag\" style=\"color:#ffb36b\"> </span><span class=\"token tag punctuation\" style=\"color:#a8a49d\">/&gt;</span><span class=\"token plain-text\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">18</span><span class=\"bp-lc\"><span class=\"token plain-text\">    </span><span class=\"token tag punctuation\" style=\"color:#a8a49d\">&lt;/</span><span class=\"token tag punctuation\" style=\"color:#a8a49d\">&gt;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">19</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">20</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span>\n</span></span></code></pre></div><p>No server route, no event-stream parsing, no key. The gateway streams from whichever provider <code>chat</code> points at today.</p><h3 id=\"pull-structured-data-out-of-the-text\">Pull structured data out of the text</h3><p>The gateway speaks the OpenAI format, so the features you already know carry over: messages, tools and structured output. <code>ai.complete</code>\nreturns the full completion, usage included. Here we turn a free-text ticket into fields we can save:</p><div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">src/inbox/triage.ts</span><span class=\"bp-code-lang\">TypeScript</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> completion </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">ai</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">complete</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;fast&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">[</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\">    </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> role</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;system&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> content</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&#x27;Reply in JSON: {&quot;category&quot;: &quot;billing&quot; | &quot;bug&quot; | &quot;account&quot; | &quot;other&quot;, &quot;urgent&quot;: boolean, &quot;order&quot;: string | null}&#x27;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\">    </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> role</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;user&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> content</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> ticket</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">body </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">6</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">]</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">7</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> responseFormat</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> type</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;json_object&quot;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> temperature</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token number\" style=\"color:#7fb2f0\">0</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">8</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">9</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">10</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> triage </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token constant\" style=\"color:#7fb2f0\">JSON</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">parse</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">completion</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">choices</span><span class=\"token punctuation\" style=\"color:#a8a49d\">[</span><span class=\"token number\" style=\"color:#7fb2f0\">0</span><span class=\"token punctuation\" style=\"color:#a8a49d\">]</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">message</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">content </span><span class=\"token operator\" style=\"color:#FF6A00\">??</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;{}&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">11</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">from</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;tickets&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">update</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">ticket</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">id</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> category</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> triage</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">category</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> urgent</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> triage</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">urgent </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span>\n</span></span></code></pre></div><p>The update goes through the same <code>tickets</code> policy as any other write, so the AI can&#x27;t help a user change a ticket they couldn&#x27;t\nchange themselves.</p><p>You can pass <code>tools</code> the same way, in OpenAI&#x27;s format. When the model asks for a tool, the completion&#x27;s message lists the\n<code>tool_calls</code>, your app runs them, and you send the results back as <code>tool</code> messages.</p><h3 id=\"find-tickets-like-this-one\">Find tickets like this one</h3><p>The best answer to a ticket is often the answer to an older one. Add a <strong>vector field</strong> to <code>tickets</code> in Studio and pick an embedding\nmodel. Pawabase fills in vectors for the rows you already have and keeps them current as tickets arrive. Then &quot;find things like this&quot;\nis one call:</p><div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">src/inbox/similar.ts</span><span class=\"bp-code-lang\">TypeScript</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> data</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> similar </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">from</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;tickets&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">similar</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\">  text</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> ticket</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">body</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\">  where</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> status</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;closed&quot;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\">  limit</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token number\" style=\"color:#7fb2f0\">5</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">6</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token comment\" style=\"color:#77736c;font-style:italic\">// each row comes back with a distance: smaller means closer</span>\n</span></span></code></pre></div><p>It&#x27;s the same table, filters and policy as every other read. There&#x27;s no separate vector database to run, no sync job to babysit, and\nno way for a search to show someone a ticket their policy hides.</p></div>\n<p>Four features, no server code, no provider key on any device. Every call is checked against your rules and recorded.</p>\n<h2 id=\"hand-the-hard-ones-to-an-agent\">Hand the hard ones to an agent</h2>\n<p>Summaries and drafts help a person work faster. Some tickets, like &quot;refund my duplicate charge&quot;, need someone to look things up and\nthen <em>do</em> something. That&#x27;s what <strong>agents</strong> are for.</p>\n<p>An agent is AI with a job and a set of tools: your tables, your flows, documents you&#x27;ve given it, and connected apps. You build it in\nStudio, choose its model from the gateway, and decide which actions need a person&#x27;s approval. When it reaches one of those actions,\nit stops and waits.</p>\n<div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">src/inbox/refunds.ts</span><span class=\"bp-code-lang\">TypeScript</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> run </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">ai</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">agents</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">run</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;refunds&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> </span><span class=\"token template-string template-punctuation string\" style=\"color:#ffd27a\">`</span><span class=\"token template-string string\" style=\"color:#ffd27a\">Ticket </span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">${</span><span class=\"token template-string interpolation\" style=\"color:#ffd27a\">ticket</span><span class=\"token template-string interpolation punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token template-string interpolation\" style=\"color:#ffd27a\">id</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token template-string string\" style=\"color:#ffd27a\">: the customer says they were charged twice.</span><span class=\"token template-string template-punctuation string\" style=\"color:#ffd27a\">`</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">if</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">run</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">status </span><span class=\"token operator\" style=\"color:#FF6A00\">===</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;waiting&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token comment\" style=\"color:#77736c;font-style:italic\">// the agent wants to do something you marked as needing approval</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">for</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> step </span><span class=\"token keyword\" style=\"color:#FF6A00\">of</span><span class=\"token plain\"> run</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">pending </span><span class=\"token operator\" style=\"color:#FF6A00\">??</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">[</span><span class=\"token punctuation\" style=\"color:#a8a49d\">]</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token builtin\" style=\"color:#ffb36b\">console</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">log</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">step</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">name</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> step</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">why</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">6</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> finished </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">ai</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">agents</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">decide</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">run</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">id</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> approve</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token boolean\" style=\"color:#FF6A00\">true</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">7</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token builtin\" style=\"color:#ffb36b\">console</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">log</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">finished</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">output</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">8</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">else</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">9</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token builtin\" style=\"color:#ffb36b\">console</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">log</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">run</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">output</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">10</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span>\n</span></span></code></pre></div>\n<p>Agents run under the same policies as everything else. An agent working for a support agent can only read and change what that person\ncould. It can never do more than the rules allow, however the prompt is worded. You can also stream a run step by step with\n<code>ai.agents.stream</code>, and give agents your help docs as a knowledge base that your app can search directly:</p>\n<div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">TypeScript</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> answers </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">ai</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">knowledge</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">search</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;help-center&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;how do refunds work&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> limit</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token number\" style=\"color:#7fb2f0\">3</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span>\n</span></span></code></pre></div>\n<h2 id=\"see-every-call-and-what-it-cost\">See every call, and what it cost</h2>\n<p>Because every call goes through the gateway, every call is visible. In Studio, the AI section shows usage over any period, and the\nrecent calls list shows each request: which model, which provider answered, how long it took, how many tokens it used, what it cost,\nand <strong>who</strong> made it, whether a signed-in user or a key.</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Pawabase Studio&#x27;s AI section: add AI to your app, build an agent, and search your data by meaning\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1440 / 1100;background-image:url(&quot;data:image/webp;base64,UklGRjwAAABXRUJQVlA4IDAAAADwAgCdASoYABIAPu1wr1KppiQnqAgBMB2JaQAAP8/0AAD+8J/ZmAfaljdP1eqAAAA=&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/studio-ai-CvTjsM1s.avif 640w, https://pawabase.com/assets/studio-ai-BAA3y_gv.avif 960w, https://pawabase.com/assets/studio-ai-zexTiaGK.avif 1280w, https://pawabase.com/assets/studio-ai-BMzg0BgO.avif 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/studio-ai-D--lRjod.webp 640w, https://pawabase.com/assets/studio-ai-BiROLyLU.webp 960w, https://pawabase.com/assets/studio-ai-CgXLrdtP.webp 1280w, https://pawabase.com/assets/studio-ai-2LxZnbK-.webp 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/studio-ai-feDgZYYC.jpg 640w, https://pawabase.com/assets/studio-ai-BZPJ96qF.jpg 960w, https://pawabase.com/assets/studio-ai-CwO7QV4t.jpg 1280w, https://pawabase.com/assets/studio-ai-BIYj1wwC.jpg 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/studio-ai-BIYj1wwC.jpg\" width=\"1440\" height=\"1100\" alt=\"Pawabase Studio&#x27;s AI section: add AI to your app, build an agent, and search your data by meaning\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>AI in Studio: connect providers, expose models, try them in the playground, and watch usage.</figcaption></figure>\n<p>When a feature suddenly costs more than it should, you find the cause in a minute: one user, one model, one bad loop. You don&#x27;t have\nto dig through a provider dashboard that only knows your key.</p>\n<p>Before you wire a model into your app, try it in the <strong>playground</strong>: pick an exposed model, send a prompt and read the answer from the\nreal provider behind it.</p>\n<h2 id=\"what-this-changes\">What this changes</h2>\n<aside class=\"bp-callout tip\" role=\"note\"><span class=\"bp-callout-icon\" aria-hidden=\"true\">✦</span><div><p class=\"bp-callout-title\">The short version</p><div class=\"bp-callout-body\"><p>Your provider keys never leave the server. Your access rules decide who may call each model. Every call is recorded with who made\nit and what it cost. And you can switch models or providers without shipping a new version of your app.</p></div></div></aside>\n<p><strong>For security</strong>, there&#x27;s no provider key on any device to leak, and no &quot;temporary&quot; proxy endpoint left open to the internet.</p>\n<p><strong>For cost</strong>, the expensive model sits behind a rule, refused requests never reach your provider, and every call carries a price\nand a name.</p>\n<p><strong>For speed</strong>, an AI feature is a model name and a few lines of code. The proxy, the auth and the streaming are already done.</p>\n<p><strong>For the future</strong>, your app depends on names you own, not on a vendor&#x27;s API. The model landscape changes every month. Your code\ndoesn&#x27;t have to.</p>\n<p>AI is no longer a separate project. It belongs in your backend, next to your users, your rules and your data. That&#x27;s where we&#x27;ve put\nit.</p>\n<h2 id=\"questions-we-hear\">Questions we hear</h2>\n<h3 id=\"is-the-publishable-key-really-safe-to-ship\">Is the publishable key really safe to ship?</h3>\n<p>Yes. It identifies your environment but grants nothing on its own. What each request may do is decided by your policies and the\nperson&#x27;s sign-in, and by default a new model is closed to everything except your servers.</p>\n<h3 id=\"do-i-need-to-use-pawabase-for-my-data-to-use-the-gateway\">Do I need to use Pawabase for my data to use the gateway?</h3>\n<p>The gateway is part of your Pawabase environment, and that&#x27;s where it gets most of its power: the same users, the same policies, and\nsearch over your own tables. If your app already signs people in with Pawabase, the gateway knows who is calling with no extra work.</p>\n<h3 id=\"what-happens-when-a-provider-is-down\">What happens when a provider is down?</h3>\n<p>If the model has a fallback, the gateway tries it when a provider rate limits, times out or fails, and your user simply gets an answer.\nWithout a fallback, your app gets a clear error it can show.</p>\n<h3 id=\"can-i-bring-a-model-the-list-doesnt-name\">Can I bring a model the list doesn&#x27;t name?</h3>\n<p>Yes. Any service that speaks the OpenAI API can be connected, including open models you host yourself.</p>\n<h3 id=\"does-pawabase-charge-for-tokens\">Does Pawabase charge for tokens?</h3>\n<p>No. You use your own provider accounts and pay them directly. The prices you enter in Studio are there so you can see what each call\ncost.</p>\n<h2 id=\"get-started\">Get started</h2>\n<ol>\n<li>Open <strong>AI</strong> in Studio and connect a provider.</li>\n<li>Expose a model under a name, like <code>chat</code>, and choose who may call it.</li>\n<li>Call <code>pawabase.ai.chat(&quot;chat&quot;, …)</code> from your app.</li>\n</ol>\n<p>The AI gateway, agents and search by meaning are part of the Pro plan and above. Every new organization gets <strong>every Pawabase feature\nfree for seven days</strong>, so you can build your AI feature end to end before you decide anything.</p>\n<p><a href=\"https://dashboard.pawabase.com/signup\" target=\"_blank\" rel=\"noreferrer noopener\">Start building on Pawabase</a>, or read the <a href=\"https://docs.pawabase.com\" target=\"_blank\" rel=\"noreferrer noopener\">AI documentation</a>.</p>",
      "image": "https://pawabase.com/blog/call-ai-models-without-exposing-your-keys/og.png",
      "date_published": "2026-11-16T00:00:00Z",
      "date_modified": "2026-11-16T00:00:00Z",
      "authors": [
        {
          "name": "The Pawabase team"
        }
      ],
      "tags": [
        "AI",
        "Product",
        "Security"
      ]
    },
    {
      "id": "https://pawabase.com/blog/introducing-pawabase",
      "url": "https://pawabase.com/blog/introducing-pawabase",
      "title": "Introducing Pawabase: the complete backend for anything you build",
      "summary": "Data, APIs, auth, access rules, storage, realtime, flows and AI agents in one system. From a weekend project to the backend a company runs on.",
      "content_html": "<p>Every product ends up needing the same backend. A database. An API in front of it. Sign-in, and then organizations, roles and\ninvitations the week after. Somewhere to put files. Background jobs. Email that doesn&#x27;t look like it came from 2009. Rules for who\nmay see what. Logs for when it breaks at 2am. And now, AI: models, keys, agents, and a way to keep all of it from leaking.</p>\n<p>None of that is the product you set out to build. It&#x27;s the tax you pay before you get to build it.</p>\n<p>Today we&#x27;re launching <strong>Pawabase</strong>: the complete backend for anything you build. One system that gives you all of those parts,\nalready working together, from the first table of a weekend project to the backend a company runs its business on.</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Pawabase Studio&#x27;s overview of an environment: requests, latency, flow runs and the latest requests, live\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1440 / 1100;background-image:url(&quot;data:image/webp;base64,UklGRjgAAABXRUJQVlA4ICwAAADwAgCdASoYABIAPu1wsFKppiSrqAgBcB2JaQAAP8h4AAD+8J3S8dLjNhQAAA==&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/studio-overview-Bb800LZA.avif 640w, https://pawabase.com/assets/studio-overview-bNsfphCQ.avif 960w, https://pawabase.com/assets/studio-overview-CuedykJ0.avif 1280w, https://pawabase.com/assets/studio-overview-FeolJx3b.avif 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/studio-overview-DllNhWQo.webp 640w, https://pawabase.com/assets/studio-overview-Csbs6AiM.webp 960w, https://pawabase.com/assets/studio-overview-BPgVdyS6.webp 1280w, https://pawabase.com/assets/studio-overview-BKPnNQhL.webp 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/studio-overview-DW73pwBb.jpg 640w, https://pawabase.com/assets/studio-overview-CCSPG5sF.jpg 960w, https://pawabase.com/assets/studio-overview-BKvxu2oQ.jpg 1280w, https://pawabase.com/assets/studio-overview-DupfrgjK.jpg 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/studio-overview-DupfrgjK.jpg\" width=\"1440\" height=\"1100\" alt=\"Pawabase Studio&#x27;s overview of an environment: requests, latency, flow runs and the latest requests, live\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>Pawabase Studio: one place to see how every part of your backend is doing, live.</figcaption></figure>\n<h2 id=\"the-problem-with-assembling-a-backend\">The problem with assembling a backend</h2>\n<p>The usual way to build a backend in 2026 is to assemble one. A database from one vendor. Authentication from another. Storage from a\nthird. A queue service for background work, an email provider plus a template tool, an automation product for the workflows, an AI\nprovider whose keys end up in three different codebases, and a log vendor to tell you which of the other seven is broken.</p>\n<p>Each one is good at its job. Together they&#x27;re a liability:</p>\n<ul>\n<li><strong>Eight sets of users and keys.</strong> Your users live in the auth provider, but your files, jobs and workflows each have their own idea\nof who&#x27;s allowed to do what. Keeping them in agreement is a project of its own.</li>\n<li><strong>Eight bills and eight dashboards.</strong> Cost becomes impossible to predict, and an incident becomes a tour of tabs.</li>\n<li><strong>Glue code that nobody owns.</strong> Webhooks between services, retries around flaky calls, a cron job that syncs two things that should\nnever have been separate.</li>\n<li><strong>Rules written five times.</strong> &quot;Members of this organization may read its orders&quot; ends up encoded in your API, your storage policy,\nyour realtime channel and your workflow tool, each in its own language. One of them is always wrong.</li>\n</ul>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Eight separate services wired together on the left; on the right, one system called Pawabase\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 820;background-image:url(&quot;data:image/webp;base64,UklGRkgAAABXRUJQVlA4IDwAAAAwAwCdASoYAAwAPu1kqk2ppaQiMAgBMB2JZwAAetFIiaQAAP7wikGTDOiL0fn+VO/DqJ5hcndmufKvAAA=&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/stitched-vs-one-ChXYOtmh.avif 640w, https://pawabase.com/assets/stitched-vs-one-_Rnz0CQz.avif 960w, https://pawabase.com/assets/stitched-vs-one-DRb8X9X_.avif 1280w, https://pawabase.com/assets/stitched-vs-one-Bjsr45dt.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/stitched-vs-one-D1Ic7dLT.webp 640w, https://pawabase.com/assets/stitched-vs-one-D5K-q_z6.webp 960w, https://pawabase.com/assets/stitched-vs-one-D-GTRSeG.webp 1280w, https://pawabase.com/assets/stitched-vs-one-CDQESRBm.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/stitched-vs-one-C-aTP41L.jpg 640w, https://pawabase.com/assets/stitched-vs-one-CVzBUoXc.jpg 960w, https://pawabase.com/assets/stitched-vs-one-C8FIg27C.jpg 1280w, https://pawabase.com/assets/stitched-vs-one-C_IOw6nn.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/stitched-vs-one-C_IOw6nn.jpg\" width=\"1600\" height=\"820\" alt=\"Eight separate services wired together on the left; on the right, one system called Pawabase\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>Stitched together, or built as one.</figcaption></figure>\n<p>We built Pawabase because we were tired of paying that tax, and we think you are too.</p>\n<h2 id=\"what-pawabase-is\">What Pawabase is</h2>\n<p>Pawabase is one backend system built on Postgres. Every part of it shares the same database, the same users and the same rules.\nYou design it visually in <strong>Pawabase Studio</strong>, call it from any app through a clean API and typed SDKs, and run it on <strong>Pawabase\nCloud</strong> with environments, backups and full visibility built in.</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Every Pawabase part around a central Postgres database: Data API, auth, policies, storage, realtime, flows, AI, mail, observability and MCP\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 1000;background-image:url(&quot;data:image/webp;base64,UklGRjgAAABXRUJQVlA4ICwAAACwAgCdASoYAA8APu1iqU2ppaOiMAgBMB2JaQAAeyAA/vCMFiS7gUvOoaOAAA==&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/one-system-sK7i6OgC.avif 640w, https://pawabase.com/assets/one-system-W2iPnEbn.avif 960w, https://pawabase.com/assets/one-system-DVjnupWp.avif 1280w, https://pawabase.com/assets/one-system-B1DIvvIJ.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/one-system-D47xBNWQ.webp 640w, https://pawabase.com/assets/one-system-B7Ye69zX.webp 960w, https://pawabase.com/assets/one-system-DZbIF9KU.webp 1280w, https://pawabase.com/assets/one-system-0aSHX7_5.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/one-system-Ctex_Qcj.jpg 640w, https://pawabase.com/assets/one-system-Ba_lUQYI.jpg 960w, https://pawabase.com/assets/one-system-B47TAHhZ.jpg 1280w, https://pawabase.com/assets/one-system-ClxZddke.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/one-system-ClxZddke.jpg\" width=\"1600\" height=\"1000\" alt=\"Every Pawabase part around a central Postgres database: Data API, auth, policies, storage, realtime, flows, AI, mail, observability and MCP\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>Ten parts, one database, one set of users, one set of rules.</figcaption></figure>\n<p>Here&#x27;s what you get, on day one, in every project.</p>\n<h3 id=\"data-and-apis\">Data and APIs</h3>\n<p>Create tables in Studio and you have an API before you&#x27;ve written a line of backend code. Every table gets a REST endpoint with\nfiltering, relations, full-text search and pagination, documented in an API explorer you can try right in the browser. Your schema\nchanges are migrations with a history you can read, and roll back when you need to.</p>\n<div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">src/orders.ts</span><span class=\"bp-code-lang\">TypeScript</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> pawabase </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">from</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;./pawabase&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token comment\" style=\"color:#77736c;font-style:italic\">// open orders for this store, newest first, with their customer attached</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> data</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> orders </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">from</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;orders&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">6</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">where</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> status</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;open&quot;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">7</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">expand</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;customer&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">8</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">perPage</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token number\" style=\"color:#7fb2f0\">20</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span>\n</span></span></code></pre></div>\n<p>Pawabase works with whatever you build your front end in. Typed SDKs for TypeScript and Python, and setup guides (with your keys\nalready filled in) for the frameworks you already use:</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: The frameworks Pawabase has setup guides for: React, Next.js, Vue, Svelte, Angular, Astro, Flutter, Swift, Android, Python, FastAPI and Node.js\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 520;background-image:url(&quot;data:image/webp;base64,UklGRkAAAABXRUJQVlA4IDQAAAAwAwCdASoYAAgAPu1iqU2ppaQiMAgBMB2JaQAAetGjJPQAAP7wViFeiqkuJCzPoCTK0FAA&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/frameworks-BaAXkEn1.avif 640w, https://pawabase.com/assets/frameworks-CpsjtVIG.avif 960w, https://pawabase.com/assets/frameworks-TGcPDJ3R.avif 1280w, https://pawabase.com/assets/frameworks-CByh7Azg.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/frameworks-Bxdhld--.webp 640w, https://pawabase.com/assets/frameworks-CmoXrC55.webp 960w, https://pawabase.com/assets/frameworks-qPSPbNeK.webp 1280w, https://pawabase.com/assets/frameworks-DxkxzAVS.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/frameworks-CfekKy4u.jpg 640w, https://pawabase.com/assets/frameworks-EuwO-wb3.jpg 960w, https://pawabase.com/assets/frameworks-BPqEP8Qs.jpg 1280w, https://pawabase.com/assets/frameworks-C-JD6eXT.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/frameworks-C-JD6eXT.jpg\" width=\"1600\" height=\"520\" alt=\"The frameworks Pawabase has setup guides for: React, Next.js, Vue, Svelte, Angular, Astro, Flutter, Swift, Android, Python, FastAPI and Node.js\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>Web, mobile and server: one backend for all of them.</figcaption></figure>\n<h3 id=\"authentication-that-grows-with-you\">Authentication that grows with you</h3>\n<p>Email and password, passkeys, social and custom sign-in providers, multi-factor authentication, sessions and devices you can see and\nrevoke. Then the part every B2B product needs and nobody wants to build: <strong>organizations</strong> for your users, with roles, permissions,\nteams, verified domains, seats and invitations. When an enterprise customer asks for single sign-on, you turn on <strong>enterprise SSO</strong>\n(SAML or OpenID Connect) for their organization, with just-in-time provisioning. You don&#x27;t spend a quarter building it.</p>\n<p>Services and AI agents get identities of their own too: <strong>machine identities</strong> with their own keys and access, so an integration\nnever has to borrow a person&#x27;s account.</p>\n<h3 id=\"access-policies-one-rule-everywhere\">Access policies: one rule, everywhere</h3>\n<p>This is the part we&#x27;re proudest of. In Pawabase you write an access rule once, as a named <strong>policy</strong>, and use it everywhere a rule\nis accepted: tables, files, realtime channels, flows and routes. &quot;A member of this organization&quot; is defined in one place and\nenforced in every one of them. Change it once and every part changes with it. Where it can, Pawabase pushes the check down into the\ndatabase query itself, so a rule never means &quot;fetch everything, then filter&quot;.</p>\n<h3 id=\"storage-realtime-and-email\">Storage, realtime and email</h3>\n<p><strong>Storage</strong> gives every project buckets with per-action rules (who may upload, download, list or delete), share links that expire\non their own, and image resizing on the fly. <strong>Realtime</strong> gives you channels with presence, durable message history and live\nqueries that update a list the moment its data changes. <strong>Mail</strong> gives you a visual template editor, variables, sent-mail history\nand delivery insight, so a password reset or an invoice email looks like your brand, not like a default.</p>\n<h3 id=\"flows-and-background-work\">Flows and background work</h3>\n<p><strong>Flows</strong> are visual workflows, built from blocks: read and write data, call an API, send email, branch on a condition, call a model.\nA flow can be triggered by an HTTP route, an event in your data, a schedule, an inbound webhook, a realtime message or another\nflow. Under them sit durable <strong>queues</strong> with retries, <strong>schedules</strong> with cron or intervals, and signed <strong>webhooks</strong> in and out.\nThe logic that usually ends up scattered across serverless functions and automation tools lives in one place you can read.</p>\n<h3 id=\"ai-built-in-not-bolted-on\">AI built in, not bolted on</h3>\n<p>Pawabase includes an <strong>AI gateway</strong>: one OpenAI-compatible address for every model you connect, with your provider keys kept on the\nserver and your access rules deciding who may call which model. On top of it, <strong>agents</strong> that can use your tables, flows,\ndocuments and connected apps, and wait for a person&#x27;s approval when they should. Any table can be made searchable <strong>by meaning</strong>\nwith vector fields, so &quot;find tickets like this one&quot; is a single call.</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Pawabase Studio&#x27;s AI section: add AI to your app, build an agent, and search your data by meaning\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1440 / 1100;background-image:url(&quot;data:image/webp;base64,UklGRjwAAABXRUJQVlA4IDAAAADwAgCdASoYABIAPu1wr1KppiQnqAgBMB2JaQAAP8/0AAD+8J/ZmAfaljdP1eqAAAA=&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/studio-ai-CvTjsM1s.avif 640w, https://pawabase.com/assets/studio-ai-BAA3y_gv.avif 960w, https://pawabase.com/assets/studio-ai-zexTiaGK.avif 1280w, https://pawabase.com/assets/studio-ai-BMzg0BgO.avif 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/studio-ai-D--lRjod.webp 640w, https://pawabase.com/assets/studio-ai-BiROLyLU.webp 960w, https://pawabase.com/assets/studio-ai-CgXLrdtP.webp 1280w, https://pawabase.com/assets/studio-ai-2LxZnbK-.webp 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/studio-ai-feDgZYYC.jpg 640w, https://pawabase.com/assets/studio-ai-BZPJ96qF.jpg 960w, https://pawabase.com/assets/studio-ai-CwO7QV4t.jpg 1280w, https://pawabase.com/assets/studio-ai-BIYj1wwC.jpg 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/studio-ai-BIYj1wwC.jpg\" width=\"1440\" height=\"1100\" alt=\"Pawabase Studio&#x27;s AI section: add AI to your app, build an agent, and search your data by meaning\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>Models, agents and search by meaning, in the same system as your data.</figcaption></figure>\n<p>And because your backend should be as easy for an AI coding assistant to work with as it is for you, every environment comes with\nan <strong>MCP server</strong>. Connect Claude, Cursor or any MCP client with a key scoped to exactly what it may touch. It can read your schema\nand build tables and flows with you, and anything permanent asks first.</p>\n<h3 id=\"operations-handled\">Operations, handled</h3>\n<p>Every project has <strong>environments</strong>: development, staging, production. Changes move between them through a reviewed <strong>promote</strong>, and\nAPI versions can run side by side so you never break a mobile app that hasn&#x27;t updated yet. <strong>Observability</strong> is built in: every\nrequest with its trace, the flows and events it caused, errors grouped by cause, latency and bandwidth, a map of where requests\ncome from, and alarms when something drifts. <strong>Backups</strong> are taken on your schedule, checked after they&#x27;re written, and restorable\nin a click, with a safety copy taken before any restore.</p>\n<h2 id=\"how-we-built-it-four-principles\">How we built it: four principles</h2>\n<p>Every decision in Pawabase comes back to four principles. They&#x27;re also the best way to judge whether it&#x27;s right for you.</p>\n<p><strong>1. One system, not a set of services.</strong> Every part shares one database, one set of users and one set of rules. When a part needs\nto know who someone is, it asks the same place. When a rule changes, it changes everywhere. This is the difference between a backend\nand a pile of integrations.</p>\n<p><strong>2. Complete, then composable.</strong> The parts work together from day one, so a new project already has sign-in, organizations, email\nand jobs. But nothing is a black box: every part is reachable through the API and the SDKs, and you can drop into code wherever you\nwant more control.</p>\n<p><strong>3. Make it visible.</strong> Clear states and useful errors beat magic that disappears when something breaks. Every request is traced,\nevery flow run is recorded step by step, every email has a history, and every backup is checked. When something goes wrong at 2am,\nthe answer is a click away, not a hunch.</p>\n<p><strong>4. Built for small teams with big ambitions.</strong> A team of three should be able to ship software that would normally take a platform\nteam to run. Pawabase handles the operational work (environments, promotes, backups, alarms) so a small team can sell to large\ncustomers without becoming an infrastructure department.</p>\n<h2 id=\"who-pawabase-is-for\">Who Pawabase is for</h2>\n<p><strong>Solo developers and indie hackers.</strong> Ship a real product on a weekend without stitching services together. The free plan carries\na prototype, and when it takes off, the same system scales with it.</p>\n<p><strong>Startups.</strong> Get to market with the backend you&#x27;d otherwise spend your first quarter building: organizations, roles, email,\nbackground jobs and AI, ready from the first commit. When your first enterprise customer asks for single sign-on, say yes.</p>\n<p><strong>Agencies and studios.</strong> Build client products on one system you know inside out, with a project per client, environments for\nreview, and a Studio clients can actually use.</p>\n<p><strong>Product teams at growing companies.</strong> Replace the tangle of services behind your internal tools and products with one backend\nyour whole team can see and safely work from.</p>\n<h2 id=\"built-for-teams-not-just-for-code\">Built for teams, not just for code</h2>\n<p>A backend isn&#x27;t only for the developer who builds it. Support needs to look up a customer. Operations needs to see what a job did.\nA founder wants to know why signups dropped yesterday. In most stacks, each of those means a ticket to an engineer.</p>\n<p>Pawabase is built so the people around a product can work from it safely. Studio gives each of them a clear view of the data and\nthe activity they need, and the same policies that protect your API decide what they can see and change. Your backend becomes\nthe shared system a team works from, not a black box only one person understands.</p>\n<h2 id=\"start-free-with-every-feature-for-seven-days\">Start free, with every feature for seven days</h2>\n<p>Pawabase Cloud has a free plan for prototypes, experiments and learning the platform, and paid plans priced by what you use:\nprojects, database size, users and traffic. Not by which features you&#x27;re allowed to have.</p>\n<aside class=\"bp-callout tip\" role=\"note\"><span class=\"bp-callout-icon\" aria-hidden=\"true\">✦</span><div><p class=\"bp-callout-title\">Try everything first</p><div class=\"bp-callout-body\"><p>Every new organization starts with <strong>seven days of every Pawabase feature</strong>, at the highest limits, with no card needed. Build\nsomething real on the whole system before you decide anything.</p></div></div></aside>\n<p>Then pick the plan that fits. Starter adds backups, data export and full request details; Pro adds the AI gateway, organizations,\nmachine identities and bot protection; Business adds enterprise SSO. Your data and projects stay yours on every plan.</p>\n<h2 id=\"questions-people-ask-us\">Questions people ask us</h2>\n<h3 id=\"is-pawabase-a-backend-as-a-service\">Is Pawabase a backend-as-a-service?</h3>\n<p>It does everything a backend-as-a-service does (database, API, auth, storage, realtime) and keeps going: organizations for your\nusers, access policies shared across every part, visual workflows, transactional email, an AI gateway and agents, environments,\ntracing and backups. We think of it as the complete backend, the system your product and your team both work from.</p>\n<h3 id=\"do-i-have-to-use-the-visual-tools\">Do I have to use the visual tools?</h3>\n<p>No. Everything you build in Studio is also available through the API and the SDKs, and your app talks to Pawabase through clean\nREST endpoints and typed clients for TypeScript and Python, with setup guides for React, Next.js, Vue, Svelte, Angular, Flutter,\niOS, Android and more. Use Studio where it&#x27;s faster, code where you prefer it.</p>\n<h3 id=\"is-my-data-locked-in\">Is my data locked in?</h3>\n<p>Your data lives in Postgres, the most widely used open database there is. Paid plans include data export and backups you can\ndownload, so your data is never trapped.</p>\n<h3 id=\"what-does-it-cost\">What does it cost?</h3>\n<p>There&#x27;s a free plan for getting started, every feature free for seven days for new organizations, and paid plans priced by what\nyou use. See <a href=\"https://pawabase.com/pricing\">pricing</a> for the details.</p>\n<h2 id=\"whats-next\">What&#x27;s next</h2>\n<p>We&#x27;re going to keep doing what we&#x27;ve done so far: make each part deeper while keeping the whole simple. Expect more flow blocks,\nmore AI connectors, richer insights, and more of the boring operational details handled before you have to think about them.</p>\n<p>If you&#x27;ve ever spent a sprint wiring services together instead of shipping your product, Pawabase is for you.</p>\n<p><a href=\"https://dashboard.pawabase.com/signup\" target=\"_blank\" rel=\"noreferrer noopener\">Start building for free</a>, read <a href=\"https://docs.pawabase.com\" target=\"_blank\" rel=\"noreferrer noopener\">the docs</a>, or come back to this\nblog. We&#x27;ll be writing about what we ship and how it works.</p>",
      "image": "https://pawabase.com/blog/introducing-pawabase/og.png",
      "date_published": "2026-11-15T00:00:00Z",
      "date_modified": "2026-11-15T00:00:00Z",
      "authors": [
        {
          "name": "The Pawabase team"
        }
      ],
      "tags": [
        "Announcement",
        "Product",
        "Backend"
      ]
    },
    {
      "id": "https://pawabase.com/blog/best-backend-as-a-service-platforms-2026",
      "url": "https://pawabase.com/blog/best-backend-as-a-service-platforms-2026",
      "title": "The 10 best backend-as-a-service platforms of 2026",
      "summary": "We ranked the leading BaaS platforms of 2026 on completeness, access control, automation, AI readiness and operations. Here is who wins, and why.",
      "content_html": "<p>Choosing a backend platform used to be a question of which database you liked. In 2026 it&#x27;s one of the biggest decisions a\nproduct team makes. The platform you pick decides how you handle sign-in and organizations, where your business logic lives, how\nyou call AI models without leaking keys, how you see what&#x27;s happening in production, and how much glue code your team will maintain\nfor the next five years.</p>\n<p>The market has never been more crowded. There are open-source platforms you run yourself, managed services from the cloud giants,\nreactive databases, single-binary backends and no-code API builders. Each one is excellent at something. Very few are excellent at\nthe thing that matters most once a product is real: carrying the whole backend, not just the database.</p>\n<p>We looked at the ten platforms teams ask us about most and ranked them on what actually decides whether a backend carries a product\npast launch. Yes, we make one of them, and we&#x27;ll be upfront about that. We&#x27;ll also be upfront about where each of the others\nshines, because the right choice depends on what you&#x27;re building.</p>\n<h2 id=\"how-we-scored-them\">How we scored them</h2>\n<p>A backend that&#x27;s delightful for a demo and painful at a hundred customers isn&#x27;t a good backend. So we weighted seven criteria by\nhow much they matter once a product is real:</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Seven scoring criteria with their weights: completeness 25%, access control 15%, developer experience 15%, automation 15%, AI readiness 10%, operations 10%, price and lock-in 10%\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 820;background-image:url(&quot;data:image/webp;base64,UklGRlwAAABXRUJQVlA4IFAAAAAwAwCdASoYAAwAPu1orU2ppqSiMAgBMB2JQAAj3TNvCY6AAP79sAfaHZf+W2FaD4CvSzoLtP/m/ft40niQl/dDem6Jk89ToCLZRPS98AAAAA==&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/rubric-CZcMOR_W.avif 640w, https://pawabase.com/assets/rubric-bi1KTv10.avif 960w, https://pawabase.com/assets/rubric-CJ96kGK8.avif 1280w, https://pawabase.com/assets/rubric-p4LJxJ3k.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/rubric-CRALiRjD.webp 640w, https://pawabase.com/assets/rubric-R2kZ8xpB.webp 960w, https://pawabase.com/assets/rubric-B2PCBxI2.webp 1280w, https://pawabase.com/assets/rubric-BY3kEdXn.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/rubric-DFtp6pEH.jpg 640w, https://pawabase.com/assets/rubric-CTRYgsX0.jpg 960w, https://pawabase.com/assets/rubric-C_tWuSF2.jpg 1280w, https://pawabase.com/assets/rubric-G0XPQMHz.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/rubric-G0XPQMHz.jpg\" width=\"1600\" height=\"820\" alt=\"Seven scoring criteria with their weights: completeness 25%, access control 15%, developer experience 15%, automation 15%, AI readiness 10%, operations 10%, price and lock-in 10%\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>The rubric: weighted toward what you need after launch, not just on day one.</figcaption></figure>\n<ul>\n<li><strong>Completeness out of the box (25%).</strong> How much of a real product&#x27;s backend is there without adding other services: data, an\nAPI, auth, organizations for your customers, storage, realtime, jobs, email and workflows. Every gap is a vendor to add and glue\nto maintain.</li>\n<li><strong>Access control model (15%).</strong> How you express who may do what, and whether one rule can protect data, files, channels and logic\nalike. Most security incidents in young products are access rules that disagree with each other.</li>\n<li><strong>Developer experience (15%).</strong> SDKs, docs, a dashboard you actually want to open, and a smooth path from local work to production.</li>\n<li><strong>Automation (15%).</strong> Background jobs, schedules, webhooks, transactional email and business workflows: the logic that makes a\nproduct feel alive.</li>\n<li><strong>AI readiness (10%).</strong> Calling models without exposing keys, rules on who may call which model, agents, search by meaning, and\ntooling for AI coding assistants.</li>\n<li><strong>Operations (10%).</strong> Environments, safe releases, logs and traces, backups and restores you&#x27;ve actually tested.</li>\n<li><strong>Price and lock-in (10%).</strong> Predictable pricing as you grow, and how hard it would be to leave.</li>\n</ul>\n<p>We judged each platform, from its documented features, against the same brief: a multi-tenant SaaS with organizations, roles,\nfile uploads, a live-updating board, a few transactional emails, a nightly job and an AI-powered summary. The question for each was\nsimple: <em>how much of that does the platform carry, and how much do you build?</em></p>\n<h2 id=\"the-ranking-at-a-glance\">The ranking at a glance</h2>\n<div class=\"bp-table\"><table><thead><tr><th>Rank</th><th>Platform</th><th>Data model</th><th>Best for</th></tr></thead><tbody><tr><td>1</td><td><strong>Pawabase</strong></td><td>Postgres</td><td>Complete products and SaaS, from first table to enterprise customers</td></tr><tr><td>2</td><td>Supabase</td><td>Postgres</td><td>Teams who want Postgres primitives and are happy to assemble the rest</td></tr><tr><td>3</td><td>Firebase</td><td>Documents</td><td>Mobile apps deep in Google&#x27;s ecosystem</td></tr><tr><td>4</td><td>Convex</td><td>Reactive documents</td><td>Reactive TypeScript apps where everything is a function</td></tr><tr><td>5</td><td>Appwrite</td><td>Documents</td><td>Teams who want an open-source platform to self-host</td></tr><tr><td>6</td><td>AWS Amplify</td><td>Mixed AWS services</td><td>Teams standardised on AWS</td></tr><tr><td>7</td><td>PocketBase</td><td>SQLite</td><td>Small apps and prototypes on a single server</td></tr><tr><td>8</td><td>Nhost</td><td>Postgres + GraphQL</td><td>GraphQL-first teams</td></tr><tr><td>9</td><td>Xano</td><td>Postgres-backed, visual</td><td>No-code and low-code builders</td></tr><tr><td>10</td><td>Back4App</td><td>Parse Server</td><td>Teams with existing Parse apps</td></tr></tbody></table></div>\n<p>Now the details.</p>\n<h2 id=\"1-pawabase\">1. Pawabase</h2>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Pawabase, ranked first of ten: best for complete products and SaaS\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 520;background-image:url(&quot;data:image/webp;base64,UklGRkYAAABXRUJQVlA4IDoAAABQAwCdASoYAAgAPu1kqU4ppaOiMAgBMB2JZwB//QKcvImHiAD+8I1m0fuwLjL0XpUNJHK8x0gg2IAA&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/rank-01-Dhs1tKUr.avif 640w, https://pawabase.com/assets/rank-01-Br_YFOla.avif 960w, https://pawabase.com/assets/rank-01-DYwvSfJU.avif 1280w, https://pawabase.com/assets/rank-01-OQ4svEnD.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/rank-01-7-fVHjrT.webp 640w, https://pawabase.com/assets/rank-01-dfVaSkRc.webp 960w, https://pawabase.com/assets/rank-01-pPLMVzkQ.webp 1280w, https://pawabase.com/assets/rank-01-CfZZebjQ.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/rank-01-B35VjEK3.jpg 640w, https://pawabase.com/assets/rank-01-up6FXgRN.jpg 960w, https://pawabase.com/assets/rank-01-COLuIu5E.jpg 1280w, https://pawabase.com/assets/rank-01-UEcecvE_.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/rank-01-UEcecvE_.jpg\" width=\"1600\" height=\"520\" alt=\"Pawabase, ranked first of ten: best for complete products and SaaS\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button></figure>\n<p><strong>Best for:</strong> any product that&#x27;s meant to become a business, from a solo developer&#x27;s first app to a B2B SaaS selling to\nenterprises.</p>\n<p>Pawabase is the only platform on this list that treats the backend as <strong>one system</strong> rather than a collection of services. Every\npart (the data API, authentication, access policies, storage, realtime, visual flows, background jobs, email, the AI gateway and\nagents, observability and backups) shares one Postgres database, one set of users and one set of rules. That single design decision\nis why it wins almost every category in our rubric.</p>\n<p>On <strong>completeness</strong>, nothing else comes close. Organizations for your customers, with roles, permissions, teams, invitations,\nverified domains and seats, are built into authentication, not a weekend of custom tables. Transactional email has a visual template\neditor, variables and sent-mail history. Business logic lives in visual <strong>flows</strong> that anyone on the team can read, triggered by\nHTTP routes, data events, schedules, inbound webhooks or realtime messages. Every item in our SaaS brief is covered without adding another service.</p>\n<p>On <strong>access control</strong>, Pawabase&#x27;s named <strong>policies</strong> are the standout feature of the year. You write a rule like &quot;a member of this\norganization&quot; once and attach it to tables, files, realtime channels, flows and routes. Every other platform here makes you express\nthe same rule separately for each kind of resource, often in a different language for each. Pawabase also pushes simple checks\ndown into the database query, so security never costs you a full table scan.</p>\n<p>On <strong>AI readiness</strong>, Pawabase ships an OpenAI-compatible <strong>AI gateway</strong> that keeps provider keys on the server and applies your\naccess rules to every model call, <strong>agents</strong> that use your data and tools and ask for approval when they should, <strong>vector search</strong>\non any table, and an <strong>MCP server</strong> that gives each AI coding assistant a key scoped to exactly what it may touch.</p>\n<p>On <strong>operations</strong>, every project gets development, staging and production environments, a reviewed <strong>promote</strong> between them, API\nversions that run side by side, request tracing that shows the flows and events each request caused, alarms, and <strong>backups</strong> that\nare verified after they&#x27;re written.</p>\n<p><strong>Standout features</strong></p>\n<ul>\n<li>One access model for tables, files, channels, flows and routes</li>\n<li>Organizations, roles, teams, invitations and enterprise SSO for your customers, built in</li>\n<li>Visual flows, queues, schedules and signed webhooks</li>\n<li>Transactional email with a template editor and history</li>\n<li>AI gateway, agents, vector search and an MCP server</li>\n<li>Environments, promote, tracing, alarms and verified backups</li>\n</ul>\n<p><strong>Trade-offs:</strong> Pawabase is newer than the household names on this list, so its community is still growing. The flip side is that\nyou need far fewer community packages, because the parts are already there.</p>\n<p><strong>Pick it if</strong> you&#x27;re building a product people will pay for, especially one that will sell to teams and companies, and you&#x27;d\nrather spend your time on the product than on its backend. Every new organization gets every feature free for seven days.</p>\n<h2 id=\"2-supabase\">2. Supabase</h2>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Supabase, ranked second of ten: best for Postgres primitives you assemble yourself\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 520;background-image:url(&quot;data:image/webp;base64,UklGRkAAAABXRUJQVlA4IDQAAABQAwCdASoYAAgAPu1kqk4ppaQiMAgBMB2JaQAAW+o9WUagAAD+8qIM948vxu0gOMje2HAA&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/rank-02-Bp5iqFkd.avif 640w, https://pawabase.com/assets/rank-02-CiOvl1J4.avif 960w, https://pawabase.com/assets/rank-02-Cw1W4kBc.avif 1280w, https://pawabase.com/assets/rank-02-B6HfKSAu.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/rank-02-DqS4WKkJ.webp 640w, https://pawabase.com/assets/rank-02-BCbxLRpJ.webp 960w, https://pawabase.com/assets/rank-02-BLp7aZwF.webp 1280w, https://pawabase.com/assets/rank-02-CoZwXtfj.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/rank-02-CtAUmEsL.jpg 640w, https://pawabase.com/assets/rank-02-Bz9Cs0Vl.jpg 960w, https://pawabase.com/assets/rank-02-CkiHppsV.jpg 1280w, https://pawabase.com/assets/rank-02-CRuLuX-U.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/rank-02-CRuLuX-U.jpg\" width=\"1600\" height=\"520\" alt=\"Supabase, ranked second of ten: best for Postgres primitives you assemble yourself\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button></figure>\n<p><strong>Best for:</strong> developers who love Postgres and want a strong set of primitives to build on.</p>\n<p>Supabase deserves its popularity. It gives you a hosted Postgres database with an auto-generated REST and GraphQL API,\nauthentication with many providers, file storage, realtime, edge functions written in TypeScript, vector support, cron and queues,\ndatabase branching, a capable dashboard, and the option to self-host. Its community and ecosystem are among the largest of any\nplatform here, and its documentation is excellent.</p>\n<p>Where it trails Pawabase against our brief is in what you assemble yourself. Access control is written as Postgres row-level security,\nin SQL, table by table, and again for storage and realtime. Organizations, roles and invitations for your customers are up to you\nto model. Business workflows mean writing and deploying edge functions, and transactional email beyond sign-in messages means\nwiring in a separate provider. None of that is hard for a strong Postgres team, but all of it is work that Pawabase has already done.</p>\n<p><strong>Standout features</strong></p>\n<ul>\n<li>Real Postgres with row-level security</li>\n<li>REST and GraphQL APIs, realtime and storage</li>\n<li>Edge functions, cron, queues and vectors</li>\n<li>Open source and self-hostable, with a big community</li>\n</ul>\n<p><strong>Trade-offs:</strong> more of the product backend is yours to build: access rules in SQL per table, organizations, workflows, email.</p>\n<p><strong>Pick it if</strong> your team enjoys SQL, wants to stay close to raw Postgres, or needs to self-host today. For a deeper look, read\n<a href=\"https://pawabase.com/blog/pawabase-vs-supabase\">Pawabase vs Supabase</a>.</p>\n<h2 id=\"3-firebase\">3. Firebase</h2>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Firebase, ranked third of ten: best for mobile apps deep in Google&#x27;s ecosystem\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 520;background-image:url(&quot;data:image/webp;base64,UklGRkAAAABXRUJQVlA4IDQAAABwAwCdASoYAAgAPu1iqk2ppaQiMAgBMB2JaQAAW+uXMsYpQAAA/vKfHG2v6DCVPiAxljgA&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/rank-03-ClCPiJED.avif 640w, https://pawabase.com/assets/rank-03-eEDFIt8u.avif 960w, https://pawabase.com/assets/rank-03-DjfCL_VM.avif 1280w, https://pawabase.com/assets/rank-03-BZIf8q0P.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/rank-03-Cg5X-gkA.webp 640w, https://pawabase.com/assets/rank-03-lpk7Ouco.webp 960w, https://pawabase.com/assets/rank-03-Bhy0fI5o.webp 1280w, https://pawabase.com/assets/rank-03-BxSMnSKw.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/rank-03-BGqHsWqS.jpg 640w, https://pawabase.com/assets/rank-03-Cmhs1FXy.jpg 960w, https://pawabase.com/assets/rank-03-kjsyGQfh.jpg 1280w, https://pawabase.com/assets/rank-03-DDaqTnWl.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/rank-03-DDaqTnWl.jpg\" width=\"1600\" height=\"520\" alt=\"Firebase, ranked third of ten: best for mobile apps deep in Google&#x27;s ecosystem\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button></figure>\n<p><strong>Best for:</strong> mobile apps that also want Google&#x27;s analytics, messaging and crash reporting.</p>\n<p>Firebase remains a powerhouse for mobile. Firestore&#x27;s realtime sync, offline support and polished client SDKs are excellent, and\nthe surrounding products (push messaging, remote config, crash reporting, analytics, hosting) are hard to beat if you live in\nGoogle&#x27;s ecosystem. Data Connect has also brought a Postgres option into the family for teams that need relational data.</p>\n<p>The trade-offs are well known. Firestore is a document database, so relational data, joins and reporting take careful design and\noften duplication. Its security rules are a language of their own. Costs that follow document reads and writes can surprise a\ngrowing app, and moving off Google Cloud later is a real project.</p>\n<p><strong>Standout features</strong></p>\n<ul>\n<li>Realtime sync and offline support on mobile</li>\n<li>Push messaging, remote config, analytics and crash reporting</li>\n<li>Massive scale on Google&#x27;s infrastructure</li>\n</ul>\n<p><strong>Trade-offs:</strong> a document data model for most of the platform; costs that can be hard to predict; deep lock-in.</p>\n<p><strong>Pick it if</strong> you&#x27;re building a mobile-first consumer app and want Google&#x27;s mobile toolkit around your backend.</p>\n<h2 id=\"4-convex\">4. Convex</h2>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Convex, ranked fourth of ten: best for reactive apps written in TypeScript\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 520;background-image:url(&quot;data:image/webp;base64,UklGRjwAAABXRUJQVlA4IDAAAADwAgCdASoYAAgAPu1kqU2ppaQiMAgBMB2JaQAAex/wQAD+8KGWyMCzp2F9k4cY4AA=&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/rank-04-DXlhX1hA.avif 640w, https://pawabase.com/assets/rank-04-DjXdJ_1K.avif 960w, https://pawabase.com/assets/rank-04-Bgiuw4ga.avif 1280w, https://pawabase.com/assets/rank-04-DACOOm6o.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/rank-04-DdMATYoL.webp 640w, https://pawabase.com/assets/rank-04-fd0z4R9k.webp 960w, https://pawabase.com/assets/rank-04-DmEnW6I-.webp 1280w, https://pawabase.com/assets/rank-04-Sr1oUR_g.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/rank-04-CSDb0Es6.jpg 640w, https://pawabase.com/assets/rank-04-N7RP3cPS.jpg 960w, https://pawabase.com/assets/rank-04-ChrZvRi6.jpg 1280w, https://pawabase.com/assets/rank-04-CaVYgrCq.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/rank-04-CaVYgrCq.jpg\" width=\"1600\" height=\"520\" alt=\"Convex, ranked fourth of ten: best for reactive apps written in TypeScript\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button></figure>\n<p><strong>Best for:</strong> TypeScript teams building highly reactive, collaborative apps.</p>\n<p>Convex rethinks the backend as TypeScript functions on top of a reactive database. Queries keep the UI up to date automatically\nwhen data changes, mutations are transactional, and scheduled functions and file storage are built in. For collaborative,\nlive-updating apps it&#x27;s a genuinely joyful developer experience, and its type safety from database to UI is first class.</p>\n<p>Its strength is also its constraint: everything is code. Access rules, workflows and integrations are functions you write and\nmaintain, and the data model is Convex&#x27;s own rather than standard SQL, which matters for reporting and portability.</p>\n<p><strong>Standout features</strong></p>\n<ul>\n<li>Reactivity by default, end to end</li>\n<li>Transactional TypeScript functions with strong typing</li>\n<li>Scheduled functions and file storage</li>\n</ul>\n<p><strong>Trade-offs:</strong> logic and rules all live in code; a non-SQL data model; less for the non-developers on your team.</p>\n<p><strong>Pick it if</strong> your product is fundamentally a live, collaborative interface and your team is all-in on TypeScript.</p>\n<h2 id=\"5-appwrite\">5. Appwrite</h2>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Appwrite, ranked fifth of ten: best for an open-source backend you self-host\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 520;background-image:url(&quot;data:image/webp;base64,UklGRkAAAABXRUJQVlA4IDQAAADwAgCdASoYAAgAPu1iqU2ppaQiMAgBMB2JaQAAetCIAAD+8KGWyMMmMygtWwAHBnDaCgAA&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/rank-05-B3J0ZwyD.avif 640w, https://pawabase.com/assets/rank-05-ltQ9l2HD.avif 960w, https://pawabase.com/assets/rank-05-C8k7fh8G.avif 1280w, https://pawabase.com/assets/rank-05-BsHyeD0a.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/rank-05-BSMuIiKf.webp 640w, https://pawabase.com/assets/rank-05-B2RPYJ58.webp 960w, https://pawabase.com/assets/rank-05-CwcbVRg9.webp 1280w, https://pawabase.com/assets/rank-05-5X-cN0fk.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/rank-05-_eUrXpKG.jpg 640w, https://pawabase.com/assets/rank-05-CWtcxA6K.jpg 960w, https://pawabase.com/assets/rank-05-DisHlaeR.jpg 1280w, https://pawabase.com/assets/rank-05-C5ENGkD0.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/rank-05-C5ENGkD0.jpg\" width=\"1600\" height=\"520\" alt=\"Appwrite, ranked fifth of ten: best for an open-source backend you self-host\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button></figure>\n<p><strong>Best for:</strong> teams that want an open-source backend they can run themselves.</p>\n<p>Appwrite offers databases, authentication, storage, functions in many languages, messaging (email, SMS and push), realtime and\nhosting, and it&#x27;s designed to be self-hosted as comfortably as it&#x27;s used in the cloud. Its console is polished and its community\nis active and welcoming.</p>\n<p>Its database API is document-style rather than raw SQL, which keeps simple apps simple but makes relational modelling and reporting\nharder. More advanced product needs, such as shared access patterns, business workflows and AI, are left to your functions.</p>\n<p><strong>Standout features</strong></p>\n<ul>\n<li>Open source and self-hostable</li>\n<li>A broad feature set, including messaging</li>\n<li>Functions in many runtimes</li>\n</ul>\n<p><strong>Trade-offs:</strong> a document-style data API; workflows and AI are your code.</p>\n<p><strong>Pick it if</strong> running your backend on your own infrastructure is a hard requirement.</p>\n<h2 id=\"6-aws-amplify\">6. AWS Amplify</h2>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: AWS Amplify, ranked sixth of ten: best for teams standardised on AWS\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 520;background-image:url(&quot;data:image/webp;base64,UklGRkIAAABXRUJQVlA4IDYAAADwAgCdASoYAAgAPu1iqk4ppaQiMAgBMB2JaQAAesD6AAD+8KGWwwtuPst3/urkEy4lUveOAAA=&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/rank-06-BPYZC1a4.avif 640w, https://pawabase.com/assets/rank-06-C5dgImxN.avif 960w, https://pawabase.com/assets/rank-06-CXEQGrXa.avif 1280w, https://pawabase.com/assets/rank-06-CcDD6Oyq.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/rank-06-CkYLhCqt.webp 640w, https://pawabase.com/assets/rank-06-8T9lOC7w.webp 960w, https://pawabase.com/assets/rank-06-I915k2yE.webp 1280w, https://pawabase.com/assets/rank-06-mfx2Sz_p.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/rank-06-svVzSxVW.jpg 640w, https://pawabase.com/assets/rank-06-mm070pP6.jpg 960w, https://pawabase.com/assets/rank-06-Cn_Eur6J.jpg 1280w, https://pawabase.com/assets/rank-06-BUtxZJ4b.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/rank-06-BUtxZJ4b.jpg\" width=\"1600\" height=\"520\" alt=\"AWS Amplify, ranked sixth of ten: best for teams standardised on AWS\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button></figure>\n<p><strong>Best for:</strong> teams already standardised on AWS.</p>\n<p>Amplify wraps AWS services (Cognito for auth, AppSync for a GraphQL API, DynamoDB for data, S3 for files and Lambda for logic)\nbehind a TypeScript-first developer experience. If your company runs on AWS, it keeps everything inside the same account,\ncompliance boundary and bill, and gives you the full depth of AWS when you need it.</p>\n<p>The cost is complexity. Your backend is many AWS services working together, and when something goes wrong you&#x27;re debugging the\nunderlying services, their permissions and their limits. For a small team, the learning curve is steep.</p>\n<p><strong>Standout features</strong></p>\n<ul>\n<li>The full power, scale and compliance story of AWS</li>\n<li>TypeScript-first backend definitions</li>\n</ul>\n<p><strong>Trade-offs:</strong> complexity; many moving AWS parts to understand; AWS lock-in.</p>\n<p><strong>Pick it if</strong> your organization has already chosen AWS for everything and has the people to run it.</p>\n<h2 id=\"7-pocketbase\">7. PocketBase</h2>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: PocketBase, ranked seventh of ten: best for small apps on a single server\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 520;background-image:url(&quot;data:image/webp;base64,UklGRkQAAABXRUJQVlA4IDgAAABQAwCdASoYAAgAPu1iqU2ppaQiMAgBMB2JaQAAW+o9WGB4AAD+8qIM9XqMg+vtZELhqJHvHAAAAA==&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/rank-07-Cz6hwLPa.avif 640w, https://pawabase.com/assets/rank-07-BVFR1ASB.avif 960w, https://pawabase.com/assets/rank-07-BNlijhBc.avif 1280w, https://pawabase.com/assets/rank-07-49YHmAID.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/rank-07-BnjFVbRa.webp 640w, https://pawabase.com/assets/rank-07-CB_i1rTP.webp 960w, https://pawabase.com/assets/rank-07-C3OphEH8.webp 1280w, https://pawabase.com/assets/rank-07-DeNxb8di.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/rank-07-DlBeLiDR.jpg 640w, https://pawabase.com/assets/rank-07-B5OMFMfp.jpg 960w, https://pawabase.com/assets/rank-07-WWudmYru.jpg 1280w, https://pawabase.com/assets/rank-07-CYLdvsD-.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/rank-07-CYLdvsD-.jpg\" width=\"1600\" height=\"520\" alt=\"PocketBase, ranked seventh of ten: best for small apps on a single server\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button></figure>\n<p><strong>Best for:</strong> small apps, internal tools and prototypes.</p>\n<p>PocketBase is a single executable that gives you a SQLite database, authentication, file storage, realtime subscriptions and an\nadmin dashboard. It&#x27;s remarkably capable for its size, starts in seconds, and extending it with Go or JavaScript hooks is\nstraightforward. For a side project or an internal tool, it&#x27;s hard to beat on simplicity.</p>\n<p>It&#x27;s designed to run on a single server, so scaling out, high availability, team-scale operations and backups are yours to handle.</p>\n<p><strong>Standout features</strong></p>\n<ul>\n<li>One file to deploy; fast and lightweight</li>\n<li>Auth, files, realtime and an admin UI included</li>\n<li>Open source and easy to extend</li>\n</ul>\n<p><strong>Trade-offs:</strong> single-node by design; operations and growth are yours to manage.</p>\n<p><strong>Pick it if</strong> you want the simplest possible backend for something small and don&#x27;t expect it to grow into a business.</p>\n<h2 id=\"8-nhost\">8. Nhost</h2>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Nhost, ranked eighth of ten: best for GraphQL-first teams on Postgres\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 520;background-image:url(&quot;data:image/webp;base64,UklGRjYAAABXRUJQVlA4ICoAAACwAgCdASoYAAgAPu1iqk2ppaQjMAgBMB2JaQAAeyAA/vChlsKyTdrv0AA=&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/rank-08-CmyNFlfC.avif 640w, https://pawabase.com/assets/rank-08-DbxJS0FO.avif 960w, https://pawabase.com/assets/rank-08-CCdrYjRR.avif 1280w, https://pawabase.com/assets/rank-08-D3fbuJyl.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/rank-08-CKpbUI18.webp 640w, https://pawabase.com/assets/rank-08-Dt22pwdt.webp 960w, https://pawabase.com/assets/rank-08-4kHCc3md.webp 1280w, https://pawabase.com/assets/rank-08-Im4UBX2d.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/rank-08-DJOJpDma.jpg 640w, https://pawabase.com/assets/rank-08-FUl9Yk3y.jpg 960w, https://pawabase.com/assets/rank-08-1HdUYXgO.jpg 1280w, https://pawabase.com/assets/rank-08-Bcgbkz5I.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/rank-08-Bcgbkz5I.jpg\" width=\"1600\" height=\"520\" alt=\"Nhost, ranked eighth of ten: best for GraphQL-first teams on Postgres\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button></figure>\n<p><strong>Best for:</strong> GraphQL-first teams who want Postgres.</p>\n<p>Nhost combines Postgres with Hasura&#x27;s GraphQL engine, plus authentication, storage and serverless functions. If your front end\nspeaks GraphQL, it&#x27;s a natural fit: your schema becomes a GraphQL API instantly, and Hasura&#x27;s permission system is expressive.</p>\n<p>Teams that don&#x27;t want GraphQL get less from it, and like most platforms here, business workflows, transactional email and AI are\nleft to your functions.</p>\n<p><strong>Standout features</strong></p>\n<ul>\n<li>Instant GraphQL on Postgres</li>\n<li>Hasura&#x27;s permission system</li>\n<li>Open source</li>\n</ul>\n<p><strong>Trade-offs:</strong> GraphQL-centric; workflows, email and AI are your code.</p>\n<p><strong>Pick it if</strong> GraphQL is your team&#x27;s default and you want it on Postgres with minimal setup.</p>\n<h2 id=\"9-xano\">9. Xano</h2>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Xano, ranked ninth of ten: best for no-code builders who need a backend\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 520;background-image:url(&quot;data:image/webp;base64,UklGRjYAAABXRUJQVlA4ICoAAACwAgCdASoYAAgAPu1kqU2ppaOiMAgBMB2JaQAAeyAA/vChlsKyTdrigAA=&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/rank-09-Q9CLszeP.avif 640w, https://pawabase.com/assets/rank-09-D1eICQdT.avif 960w, https://pawabase.com/assets/rank-09-DHYWkAow.avif 1280w, https://pawabase.com/assets/rank-09-5Uc7oUOX.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/rank-09-D8RYtFpr.webp 640w, https://pawabase.com/assets/rank-09-D1S7sK_Z.webp 960w, https://pawabase.com/assets/rank-09-I1PPcWDK.webp 1280w, https://pawabase.com/assets/rank-09-CR3ujDBc.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/rank-09-BkvC2ajN.jpg 640w, https://pawabase.com/assets/rank-09-D9OEmzR4.jpg 960w, https://pawabase.com/assets/rank-09-DX1m9kIV.jpg 1280w, https://pawabase.com/assets/rank-09-Dh12E6pe.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/rank-09-Dh12E6pe.jpg\" width=\"1600\" height=\"520\" alt=\"Xano, ranked ninth of ten: best for no-code builders who need a backend\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button></figure>\n<p><strong>Best for:</strong> no-code and low-code builders who need a real backend.</p>\n<p>Xano gives you a database and a visual API builder, so people who don&#x27;t write backend code can still create endpoints with real\nlogic, authentication and integrations. It pairs well with no-code front-end tools and has helped a lot of non-developers ship\nreal products.</p>\n<p>Developers who prefer code-first workflows, typed SDKs and standard tooling may find it limiting, and its visual builder is focused\non APIs rather than the full set of product backend needs.</p>\n<p><strong>Standout features</strong></p>\n<ul>\n<li>Visual API building</li>\n<li>Approachable for non-developers</li>\n</ul>\n<p><strong>Trade-offs:</strong> less suited to code-first teams; a narrower backend scope.</p>\n<p><strong>Pick it if</strong> your team builds with no-code tools and needs a backend to match. If you want visual logic <em>and</em> code-first tools in\none place, Pawabase&#x27;s flows give you both.</p>\n<h2 id=\"10-back4app\">10. Back4App</h2>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Back4App, ranked tenth of ten: best for existing Parse Server apps\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 520;background-image:url(&quot;data:image/webp;base64,UklGRkIAAABXRUJQVlA4IDYAAADwAgCdASoYAAgAPu1kqk4ppaQiMAgBMB2JaQAAesE4gAD+8KGWyMMmMybVNb/a2f8jJAaCgAA=&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/rank-10-BZFTupRk.avif 640w, https://pawabase.com/assets/rank-10-OwF7ZvnC.avif 960w, https://pawabase.com/assets/rank-10-B8dOLr8H.avif 1280w, https://pawabase.com/assets/rank-10-DIWPCDw7.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/rank-10-DJetQ6_E.webp 640w, https://pawabase.com/assets/rank-10-D_N2JFmh.webp 960w, https://pawabase.com/assets/rank-10-3mhNgim8.webp 1280w, https://pawabase.com/assets/rank-10-D76Zonyi.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/rank-10-BrPtbh72.jpg 640w, https://pawabase.com/assets/rank-10-D72e5IwW.jpg 960w, https://pawabase.com/assets/rank-10-CH_BPp-p.jpg 1280w, https://pawabase.com/assets/rank-10-BKAW9Sw7.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/rank-10-BKAW9Sw7.jpg\" width=\"1600\" height=\"520\" alt=\"Back4App, ranked tenth of ten: best for existing Parse Server apps\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button></figure>\n<p><strong>Best for:</strong> teams running apps built on Parse Server.</p>\n<p>Back4App hosts the open-source Parse Server, with REST and GraphQL APIs, cloud code and a dashboard. For teams with existing Parse\napps, it&#x27;s a well-trodden path that keeps them running without managing servers.</p>\n<p>For new projects, the Parse model shows its age next to the platforms above, particularly around modern auth, access control and\nAI.</p>\n<p><strong>Standout features</strong></p>\n<ul>\n<li>Managed Parse Server</li>\n<li>A mature API surface</li>\n</ul>\n<p><strong>Trade-offs:</strong> an older platform model; fewer modern features for new products.</p>\n<p><strong>Pick it if</strong> you already have a Parse app and want it hosted.</p>\n<h2 id=\"the-patterns-behind-the-ranking\">The patterns behind the ranking</h2>\n<p>Looking across all ten, three patterns decided most of the ranking.</p>\n<p><strong>Primitives aren&#x27;t products.</strong> Most platforms here give you excellent building blocks (a database, an API, auth, functions) and\nleave the product backend to you. The gap between &quot;we have auth&quot; and &quot;our customers have organizations, roles, invitations and\nSSO&quot; is months of work. Platforms that close that gap win.</p>\n<p><strong>Rules that live in one place are rules that stay correct.</strong> When access rules are written separately for tables, files,\nrealtime and logic, they drift apart, and drifting rules are how data leaks. A single access model across every part is the most\nunderrated feature in this category.</p>\n<p><strong>AI raised the stakes.</strong> Two years ago, a backend didn&#x27;t need to know about models. Today almost every product calls one, and the\nbackend is where keys must live, where rules must apply, and where agents get their tools. Platforms that treat AI as a first-class\npart of the backend are pulling ahead.</p>\n<h2 id=\"frequently-asked-questions\">Frequently asked questions</h2>\n<h3 id=\"what-is-a-backend-as-a-service\">What is a backend-as-a-service?</h3>\n<p>A backend-as-a-service (BaaS) gives you the server side of an app (a database, an API, authentication, file storage and usually\nrealtime) as a managed service, so you don&#x27;t build and run those parts yourself. The best platforms in 2026 go further, with access\ncontrol, background jobs, workflows, email and AI.</p>\n<h3 id=\"which-baas-is-best-for-a-saas-product\">Which BaaS is best for a SaaS product?</h3>\n<p>For a SaaS, the deciding features are organizations and roles for your customers, one access model for every part of the backend,\nbusiness workflows and enterprise SSO. Pawabase is the only platform on this list with all of them built in, which is why it ranks\nfirst for SaaS.</p>\n<h3 id=\"which-baas-is-best-for-ai-apps\">Which BaaS is best for AI apps?</h3>\n<p>Look for three things: a way to call models without shipping provider keys to the browser, rules on who may call which model, and\nsearch by meaning over your own data. Pawabase covers all three with its AI gateway, policies and vector fields, and adds agents and\nan MCP server on top.</p>\n<h3 id=\"is-postgres-better-than-a-document-database-for-a-baas\">Is Postgres better than a document database for a BaaS?</h3>\n<p>For most products, yes. Relational data, reporting, joins and constraints come naturally in Postgres, and it keeps your data\nportable. Pawabase, Supabase and Nhost are Postgres-based; Firebase and Appwrite use document-style data models for most of their\nplatforms.</p>\n<h3 id=\"can-i-switch-backends-later\">Can I switch backends later?</h3>\n<p>You can, but it gets more expensive every month, because your access rules, logic and integrations are written against the platform\nyou chose. That&#x27;s the strongest argument for choosing a complete system early.</p>\n<h2 id=\"how-to-choose\">How to choose</h2>\n<p>If you remember one thing from this ranking, make it this: <strong>the cost of a backend isn&#x27;t the first month, it&#x27;s the glue you write\nfor the next sixty.</strong> Every service you add is another set of users to sync, another rule to keep in agreement, another bill and\nanother dashboard during an incident.</p>\n<ul>\n<li>Building a <strong>real product or SaaS</strong>, especially one that will sell to teams and companies? <strong>Pawabase</strong> gives you the whole\nsystem, including organizations, enterprise SSO, workflows and AI, without the assembly.</li>\n<li>Want <strong>Postgres primitives</strong> and enjoy building the rest yourself? Supabase is a strong choice.</li>\n<li>Building a <strong>mobile app</strong> deep in Google&#x27;s ecosystem? Firebase.</li>\n<li>Building something <strong>highly reactive in TypeScript</strong>? Convex.</li>\n<li>Need to <strong>self-host open source</strong>? Appwrite or PocketBase, depending on scale.</li>\n<li>Standardised on <strong>AWS</strong>? Amplify.</li>\n</ul>\n<aside class=\"bp-callout tip\" role=\"note\"><span class=\"bp-callout-icon\" aria-hidden=\"true\">✦</span><div><p class=\"bp-callout-title\">See for yourself</p><div class=\"bp-callout-body\"><p>Every new Pawabase organization gets <strong>seven days of every feature</strong> at the highest limits. Build the hardest part of your\nproduct on it, organizations, access rules and a flow or two, and compare that to what it takes anywhere else.</p></div></div></aside>\n<p><a href=\"https://dashboard.pawabase.com/signup\" target=\"_blank\" rel=\"noreferrer noopener\">Start free on Pawabase</a>, or read our deeper comparison of\n<a href=\"https://pawabase.com/blog/pawabase-vs-supabase\">Pawabase and Supabase</a>.</p>",
      "image": "https://pawabase.com/blog/best-backend-as-a-service-platforms-2026/og.png",
      "date_published": "2026-11-13T00:00:00Z",
      "date_modified": "2026-11-13T00:00:00Z",
      "authors": [
        {
          "name": "The Pawabase team"
        }
      ],
      "tags": [
        "Comparison",
        "Backend",
        "BaaS"
      ]
    },
    {
      "id": "https://pawabase.com/blog/pawabase-vs-supabase",
      "url": "https://pawabase.com/blog/pawabase-vs-supabase",
      "title": "Pawabase vs Supabase: which backend should you build on in 2026?",
      "summary": "Both run on Postgres. Supabase hands you primitives to assemble; Pawabase hands you the whole system. A side-by-side look at what that means for your product.",
      "content_html": "<p>If you&#x27;re choosing a backend in 2026 and you like Postgres, you&#x27;ve probably narrowed it down to two names. Supabase, the open-source\nplatform that made &quot;Postgres with an API&quot; mainstream. And Pawabase, the complete backend built on Postgres for products that are\nmeant to become businesses.</p>\n<p>They start from the same place, and that&#x27;s exactly why the comparison is interesting. Both give you a real Postgres database, an\nAPI for every table, authentication, storage and realtime. The difference is everything that comes after: <strong>Supabase gives you\nexcellent primitives and leaves the product backend for you to assemble. Pawabase gives you that product backend, already built.</strong></p>\n<p>Here&#x27;s what that means in practice.</p>\n<h2 id=\"the-short-version\">The short version</h2>\n<div class=\"bp-table\"><table><thead><tr><th></th><th>Pawabase</th><th>Supabase</th></tr></thead><tbody><tr><td>Database</td><td>Postgres</td><td>Postgres</td></tr><tr><td>API for every table</td><td>REST, filters, relations, search</td><td>REST and GraphQL</td></tr><tr><td>Access rules</td><td>Named policies, reused across tables, files, channels, flows, routes</td><td>Row-level security in SQL, per table</td></tr><tr><td>Organizations, roles, teams for your users</td><td>Built in</td><td>You model them</td></tr><tr><td>Enterprise SSO for your customers</td><td>Built in, per organization</td><td>Available</td></tr><tr><td>Business logic</td><td>Visual flows, plus routes, jobs and schedules</td><td>Edge functions you write in TypeScript</td></tr><tr><td>Transactional email</td><td>Template editor, sending and history built in</td><td>Bring your own provider and templates</td></tr><tr><td>AI</td><td>Gateway, agents, vector search, MCP</td><td>Vector search, AI tooling, MCP</td></tr><tr><td>Environments</td><td>Development, staging, production with a reviewed promote</td><td>Branching</td></tr><tr><td>Observability</td><td>Request traces with the flows and events they caused, alarms</td><td>Logs and reports</td></tr></tbody></table></div>\n<p>Both are good platforms. The question is how much of your product&#x27;s backend you want to build yourself.</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: What a typical SaaS needs, and whether Pawabase or Supabase carries it: built in, SQL per table, or your code\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 1060;background-image:url(&quot;data:image/webp;base64,UklGRj4AAABXRUJQVlA4IDIAAAAQAwCdASoYABAAPu1iqU2ppaOiMAgBMB2JZwAAetCXRIAA/vCHWsk3HMQ6KZq9jgAAAA==&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/where-the-work-lives-C72Al5iL.avif 640w, https://pawabase.com/assets/where-the-work-lives-Cxq_O5wx.avif 960w, https://pawabase.com/assets/where-the-work-lives-BSH8bltH.avif 1280w, https://pawabase.com/assets/where-the-work-lives-W7NNmClm.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/where-the-work-lives-jv-DMF4O.webp 640w, https://pawabase.com/assets/where-the-work-lives-CfB0A2ei.webp 960w, https://pawabase.com/assets/where-the-work-lives-Bf0uX0vY.webp 1280w, https://pawabase.com/assets/where-the-work-lives-BLOEOb5j.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/where-the-work-lives-l-j_5rGC.jpg 640w, https://pawabase.com/assets/where-the-work-lives-AD0q5TZo.jpg 960w, https://pawabase.com/assets/where-the-work-lives-KMd5yht9.jpg 1280w, https://pawabase.com/assets/where-the-work-lives-BwkZl-8q.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/where-the-work-lives-BwkZl-8q.jpg\" width=\"1600\" height=\"1060\" alt=\"What a typical SaaS needs, and whether Pawabase or Supabase carries it: built in, SQL per table, or your code\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>Where the work lives: built into the platform, or code your team writes and runs.</figcaption></figure>\n<h2 id=\"access-control-one-rule-or-one-rule-per-table\">Access control: one rule, or one rule per table</h2>\n<p>This is the biggest difference between the two, and the one you&#x27;ll feel every week.</p>\n<p>In <strong>Supabase</strong>, access control is Postgres row-level security. It&#x27;s powerful and it lives right in the database, but you write it\nas SQL, table by table. Here&#x27;s the classic &quot;members of an organization may read its orders&quot; rule:</p>\n<div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">Supabase: one table&#x27;s policy</span><span class=\"bp-code-lang\">SQL</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">create</span><span class=\"token plain\"> policy </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;members can read their organization&#x27;s orders&quot;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">on</span><span class=\"token plain\"> orders </span><span class=\"token keyword\" style=\"color:#FF6A00\">for</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">select</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">using</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">exists</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\">    </span><span class=\"token keyword\" style=\"color:#FF6A00\">select</span><span class=\"token plain\"> </span><span class=\"token number\" style=\"color:#7fb2f0\">1</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">from</span><span class=\"token plain\"> memberships m</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">6</span><span class=\"bp-lc\"><span class=\"token plain\">    </span><span class=\"token keyword\" style=\"color:#FF6A00\">where</span><span class=\"token plain\"> m</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">org_id </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> orders</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">org_id</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">7</span><span class=\"bp-lc\"><span class=\"token plain\">      </span><span class=\"token operator\" style=\"color:#FF6A00\">and</span><span class=\"token plain\"> m</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">user_id </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> auth</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">uid</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">8</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">9</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span>\n</span></span></code></pre></div>\n<p>Now write it again for <code>invoices</code>. And <code>projects</code>. And <code>comments</code>. Then express it for file storage, whose objects have their own\npolicies. Then for realtime channels. A real product has dozens of tables, and every one needs its rules written, reviewed and kept\nin agreement with the rest. When the rule changes, say a new &quot;viewer&quot; role, you&#x27;re editing SQL in many places and hoping you found\nthem all.</p>\n<p>In <strong>Pawabase</strong>, you write that rule once as a named <strong>policy</strong>, in Studio or in your project&#x27;s definitions, and attach it wherever\na rule is accepted: tables (with separate rules for read, write and delete), files, realtime channels, flows and routes.</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: A single policy, team_member, used by tables, files, channels, flows and routes\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 760;background-image:url(&quot;data:image/webp;base64,UklGRkAAAABXRUJQVlA4IDQAAACwAgCdASoYAAsAPu1kqU2ppaOiMAgBMB2JaQAAeyAA/vCgEaLHnkW8lLvgKgk4ug0FAAAA&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/one-rule-itIEaffb.avif 640w, https://pawabase.com/assets/one-rule-mHVIVKij.avif 960w, https://pawabase.com/assets/one-rule-C4YFRDPR.avif 1280w, https://pawabase.com/assets/one-rule-DKVHNnAY.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/one-rule-6_IXKfE5.webp 640w, https://pawabase.com/assets/one-rule-tURrsail.webp 960w, https://pawabase.com/assets/one-rule-CY6AO77M.webp 1280w, https://pawabase.com/assets/one-rule-b2J37YKj.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/one-rule-CarImnwG.jpg 640w, https://pawabase.com/assets/one-rule-DHs-ST7B.jpg 960w, https://pawabase.com/assets/one-rule-CfAVRFdF.jpg 1280w, https://pawabase.com/assets/one-rule-D3D-nK5f.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/one-rule-D3D-nK5f.jpg\" width=\"1600\" height=\"760\" alt=\"A single policy, team_member, used by tables, files, channels, flows and routes\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>One policy, enforced by every part that accepts one.</figcaption></figure>\n<p>Change <code>team_member</code> once and every table, bucket and channel that uses it changes with it. Pawabase pushes simple checks down into\nthe database query, so it never means &quot;load everything, then filter&quot;, and Studio shows each policy in plain language, so the\nperson reviewing access doesn&#x27;t need to read SQL.</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Pawabase Studio&#x27;s Policies page: named, described access rules reused across the project\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1440 / 1100;background-image:url(&quot;data:image/webp;base64,UklGRkQAAABXRUJQVlA4IDgAAADwAgCdASoYABIAPu1qr1CtJaQiqAqpoB2JaQAAOsg2AAD+8LOZzwnrkb+fO4LarZAWu3YcJNgAAA==&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/studio-policies-C-jx8Eyg.avif 640w, https://pawabase.com/assets/studio-policies-ygEXsLgu.avif 960w, https://pawabase.com/assets/studio-policies-CvZ8Z-3n.avif 1280w, https://pawabase.com/assets/studio-policies-BMHyGVJT.avif 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/studio-policies-CcfWCAkQ.webp 640w, https://pawabase.com/assets/studio-policies-C6wNZ5Ld.webp 960w, https://pawabase.com/assets/studio-policies-Dyce2E3z.webp 1280w, https://pawabase.com/assets/studio-policies-jUKHoxW5.webp 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/studio-policies-DxsIezzd.jpg 640w, https://pawabase.com/assets/studio-policies-BLXLHjBy.jpg 960w, https://pawabase.com/assets/studio-policies-BgxIxS4w.jpg 1280w, https://pawabase.com/assets/studio-policies-DN3rPOkv.jpg 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/studio-policies-DN3rPOkv.jpg\" width=\"1440\" height=\"1100\" alt=\"Pawabase Studio&#x27;s Policies page: named, described access rules reused across the project\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>Policies in Studio: named, described and reused, not rewritten per table.</figcaption></figure>\n<h2 id=\"organizations-for-your-users\">Organizations for your users</h2>\n<p>Almost every B2B product needs the same thing: users belong to organizations, organizations have roles and permissions, people are\ninvited, some customers verify their email domain so colleagues join automatically, and eventually someone pays for seats.</p>\n<p><strong>Supabase</strong> gives you excellent authentication for individual users and leaves the organization model to you. That means designing\nmembership tables, roles and invitations, writing RLS that understands them, building the invitation emails and flows, and\nmaintaining it all.</p>\n<p><strong>Pawabase</strong> has organizations built into authentication: roles and permissions, teams, invitations, verified domains, seats and\norganization-level multi-factor requirements. Organization membership and role travel in the user&#x27;s session, so your policies can\ncheck them directly. When your first enterprise customer asks for single sign-on, you turn on <strong>enterprise SSO</strong> for their\norganization, with SAML or OpenID Connect and just-in-time role assignment, instead of starting a project.</p>\n<h2 id=\"business-logic-visual-flows-or-functions-you-deploy\">Business logic: visual flows, or functions you deploy</h2>\n<p>Every product has logic that isn&#x27;t a simple read or write. Send a welcome email and add the user to a trial. When an order is paid,\nupdate stock, notify the warehouse and email a receipt. Every night, find abandoned carts and send a reminder.</p>\n<p><strong>Supabase</strong> handles this with edge functions, written in TypeScript and deployed separately, plus cron and queues to trigger them.\nIt&#x27;s flexible, and it&#x27;s code you write, test, deploy, monitor and keep in sync with your schema and your access rules.</p>\n<p><strong>Pawabase</strong> gives you <strong>flows</strong>: visual workflows built from blocks that read and write data, call APIs, send email, branch and\ncall AI models. A flow can be triggered by an HTTP route, a data event, a schedule, an inbound webhook, a realtime message or another\nflow. It runs under the same policies as the rest of your backend, and every run is recorded with its steps, so you can see exactly\nwhat happened and why.</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Pawabase Studio&#x27;s Flows page, listing visual workflows with their triggers, number of blocks and state\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1440 / 1100;background-image:url(&quot;data:image/webp;base64,UklGRkAAAABXRUJQVlA4IDQAAAAwAwCdASoYABIAPu1srVEppaQiqAqpMB2JaQAAOob1gDYAAP7wh1u2UvsQC63wbbWcAAAA&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/studio-flows-_8vPEDKj.avif 640w, https://pawabase.com/assets/studio-flows-C7jRqcA8.avif 960w, https://pawabase.com/assets/studio-flows-HgN5uj8v.avif 1280w, https://pawabase.com/assets/studio-flows-DpsNsSmz.avif 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/studio-flows-C7TJUwSw.webp 640w, https://pawabase.com/assets/studio-flows-el-Lc5Fk.webp 960w, https://pawabase.com/assets/studio-flows-CruQYMmT.webp 1280w, https://pawabase.com/assets/studio-flows-Ci1rEMeC.webp 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/studio-flows-B_10aWdP.jpg 640w, https://pawabase.com/assets/studio-flows-DlKlbtXs.jpg 960w, https://pawabase.com/assets/studio-flows-DlE_S745.jpg 1280w, https://pawabase.com/assets/studio-flows-C8SHpPj5.jpg 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/studio-flows-C8SHpPj5.jpg\" width=\"1440\" height=\"1100\" alt=\"Pawabase Studio&#x27;s Flows page, listing visual workflows with their triggers, number of blocks and state\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>Flows in a real store backend: routes, schedules and webhooks, all readable by the team.</figcaption></figure>\n<p>The result is logic your whole team can read. Product managers can see what happens when an order is paid. Support can see why an\nemail didn&#x27;t go out. Developers can still drop into code when they want to, through routes and the API.</p>\n<h2 id=\"email-thats-part-of-the-product\">Email that&#x27;s part of the product</h2>\n<p>Transactional email is one of those things that&#x27;s &quot;just an integration&quot; until you need branded templates, variables, previews,\na history of what was sent and why something bounced.</p>\n<p><strong>Supabase</strong> sends its authentication emails (sign-up confirmations, magic links, password resets) through a default sender or\nthe SMTP server you configure. For everything else, receipts, notifications and invitations, you bring an email provider and build\nthe templates and sending logic yourself.</p>\n<p><strong>Pawabase</strong> has <strong>Mail</strong> built in: a visual template editor with your brand kit, variables and previews, sending from flows or the\nAPI, sent-mail history and delivery insight. Projects that don&#x27;t have a provider yet can start on Pawabase&#x27;s own sender.</p>\n<h2 id=\"ai-a-gateway-and-agents-not-just-vectors\">AI: a gateway and agents, not just vectors</h2>\n<p>Both platforms support vector search on Postgres, and both offer an MCP server so AI coding assistants can work with your backend.</p>\n<p>Pawabase goes further in your product itself. Its <strong>AI gateway</strong> gives your app one OpenAI-compatible address for every model you\nconnect. Your provider keys stay on the server, and your policies decide who may call which model. That&#x27;s the difference between\n&quot;we added AI&quot; and &quot;we added AI safely&quot;. On top of it, <strong>agents</strong> can use your tables, flows, documents and connected apps, and stop\nfor a person&#x27;s approval when they should. The <strong>MCP server</strong> gives each AI assistant a key scoped to exactly what it may touch, and\nanything permanent asks first.</p>\n<h2 id=\"operations-and-visibility\">Operations and visibility</h2>\n<p><strong>Supabase</strong> offers branching for preview environments, logs and reports in its dashboard, and backups on its paid plans.</p>\n<p><strong>Pawabase</strong> gives every project development, staging and production <strong>environments</strong>, with changes moving through a reviewed\n<strong>promote</strong>, and API versions that can run side by side so an old mobile app never breaks. Its <strong>observability</strong> traces every request\ntogether with the flows, events and jobs it caused, groups errors by cause, maps where requests come from, and raises alarms when\nsomething drifts. <strong>Backups</strong> are checked after they&#x27;re written and restored with a safety copy taken first.</p>\n<h2 id=\"developer-experience\">Developer experience</h2>\n<p>Both platforms have a good dashboard and good SDKs, so this comes down to what you spend your day doing.</p>\n<p>On <strong>Supabase</strong>, much of your day is in SQL and code: designing tables, writing row-level security, writing and deploying edge\nfunctions, and connecting the services around them. Its dashboard is a capable window onto Postgres, and its client libraries are\nmature.</p>\n<p>On <strong>Pawabase</strong>, <strong>Studio</strong> is where the whole backend is built and run. Tables, policies, sign-in, organizations, flows, email\ntemplates, AI models and agents, environments, backups and live activity all live in one place, with a command search to jump\nanywhere. The <strong>API Explorer</strong> lets you try every endpoint with real data. The <strong>Connect</strong> panel writes the setup for your framework\n(React, Next.js, Vue, Svelte, Angular, Astro, Flutter, iOS, Android, Node, Python and more) and your package manager, with the right\nkeys filled in. And the typed SDKs for TypeScript and Python feel like the API: <code>pawabase.from(&quot;orders&quot;).where({ status: &quot;paid&quot; })</code>.</p>\n<p>The difference you&#x27;ll feel most is how much of the system your team can see. In Pawabase, a product manager can open a flow and\nunderstand what happens when an order is paid, and support can find a customer and see their recent activity, all under the same\nrules that protect your API.</p>\n<h2 id=\"realtime-and-storage\">Realtime and storage</h2>\n<p>Both platforms do realtime and file storage well, with different emphases.</p>\n<p><strong>Realtime.</strong> Supabase offers broadcast, presence and database change streams. Pawabase offers channels with presence, durable\nmessage history so a client that reconnects catches up, and <strong>live queries</strong> that re-run a list and push the new result when its\ndata changes. Its channel rules use the same policies as everything else, so &quot;members of this organization may subscribe&quot; is the\nsame <code>team_member</code> rule you already wrote. Studio shows every channel, who is subscribed and what was sent.</p>\n<p><strong>Storage.</strong> Both give you buckets, access rules and image transformations. Pawabase adds per-action rules (upload, download, list\nand delete can each have their own policy), share links that expire on their own, and profile pictures for your users handled for\nyou.</p>\n<h2 id=\"pricing-approach\">Pricing approach</h2>\n<p>We won&#x27;t quote Supabase&#x27;s prices here, because they change; check their pricing page for the current numbers. What we can describe\nis the approach.</p>\n<p>Pawabase prices by what you use: projects, database size, users and traffic. There&#x27;s a free plan for prototypes, every feature free\nfor seven days for new organizations, and paid plans from there. The features that cost Pawabase real money to provide, like\nbackups, data export and full request details, start on Starter, and team, AI and enterprise features on higher plans. You never\nneed a second vendor to fill a gap, which is where most backend bills actually grow.</p>\n<h2 id=\"where-supabase-is-the-better-fit\">Where Supabase is the better fit</h2>\n<p>We&#x27;ll be straight about it. Supabase is a great choice if:</p>\n<ul>\n<li>you want to <strong>self-host</strong> an open-source platform today;</li>\n<li>your team enjoys writing <strong>SQL and row-level security</strong> and wants to stay as close to raw Postgres as possible;</li>\n<li>you need <strong>GraphQL</strong> out of the box;</li>\n<li>your app is mostly CRUD and you don&#x27;t expect to need organizations, workflows, email or an AI gateway.</li>\n</ul>\n<h2 id=\"where-pawabase-wins\">Where Pawabase wins</h2>\n<p>Pawabase is the better fit when you&#x27;re building a <strong>product meant to become a business</strong>:</p>\n<ul>\n<li>a <strong>SaaS or B2B app</strong> that needs organizations, roles, invitations and, eventually, enterprise SSO;</li>\n<li>a product with real <strong>business logic</strong> that you want visible and maintainable, not scattered across functions;</li>\n<li>a team that wants <strong>one access model</strong> for data, files, channels and logic;</li>\n<li>anyone adding <strong>AI</strong> who wants keys on the server and rules on every call;</li>\n<li>teams that want <strong>environments, tracing and backups</strong> handled from day one.</li>\n</ul>\n<p>In short: if you&#x27;d rather spend the next six months on your product than on its backend, Pawabase is the one to build on.</p>\n<h2 id=\"frequently-asked-questions\">Frequently asked questions</h2>\n<h3 id=\"is-pawabase-a-supabase-alternative\">Is Pawabase a Supabase alternative?</h3>\n<p>Yes. Both are Postgres-based backend platforms with an API for every table, auth, storage and realtime. Pawabase adds what you\nwould otherwise build on top of Supabase: shared access policies, organizations for your users, visual flows, transactional email,\nan AI gateway and agents.</p>\n<h3 id=\"which-is-easier-to-secure\">Which is easier to secure?</h3>\n<p>Pawabase. With row-level security you write and review SQL policies table by table, and again for storage and realtime. With\nPawabase you write named policies once and attach them everywhere, and Studio shows each one in plain language.</p>\n<h3 id=\"which-is-better-for-b2b-saas\">Which is better for B2B SaaS?</h3>\n<p>Pawabase, because organizations, roles, invitations, verified domains, seats and enterprise SSO for your customers are built in.\nOn Supabase, that model is yours to design and maintain.</p>\n<h3 id=\"can-i-use-both\">Can I use both?</h3>\n<p>You can, but you&#x27;d be running two sets of users and rules, which is the problem Pawabase exists to remove. Most teams pick one\nsystem for the product backend.</p>\n<h2 id=\"moving-from-supabase-to-pawabase\">Moving from Supabase to Pawabase</h2>\n<p>Because both run on Postgres, a move is a translation, not a rewrite. Here&#x27;s the path we recommend.</p>\n<div class=\"bp-steps\"><h3 id=\"bring-your-schema-and-data\">Bring your schema and data</h3><p>Create a Pawabase project and recreate your tables, or import your data. Each table gets an API immediately, and your column\ntypes, relations and constraints carry over because it&#x27;s Postgres on both sides.</p><h3 id=\"turn-row-level-security-into-policies\">Turn row-level security into policies</h3><p>List your RLS policies and group them by what they <em>mean</em>: &quot;the row&#x27;s owner&quot;, &quot;a member of the row&#x27;s organization&quot;, &quot;an admin&quot;. Each\ngroup becomes one named policy in Pawabase, attached to every table, bucket and channel that used it. Most teams end up with a\nhandful of policies where they had dozens of SQL statements.</p><h3 id=\"move-sign-in-and-organizations\">Move sign-in and organizations</h3><p>Turn on the same sign-in methods in Pawabase. If you modelled organizations yourself, map your membership tables onto Pawabase\norganizations, roles and teams, and retire the custom tables, invitation code and emails you maintained.</p><h3 id=\"rebuild-edge-functions-as-flows\">Rebuild edge functions as flows</h3><p>Most edge functions are glue: when this happens, do that, then send an email. Rebuild each as a flow with the same trigger, and keep\nanything genuinely custom as a route. Every run is now recorded with its steps, which makes the first week after a migration much\ncalmer.</p><h3 id=\"point-your-app-at-pawabase\">Point your app at Pawabase</h3><p>Swap the client for <code>@pawabase/client</code>, use Connect to generate the setup for your framework, and test against your development\nenvironment. When everything passes, promote to production.</p></div>\n<p>What you gain is everything you&#x27;d otherwise have kept building yourself: one access model, organizations, flows, email, an AI\ngateway, environments and tracing.</p>\n<aside class=\"bp-callout tip\" role=\"note\"><span class=\"bp-callout-icon\" aria-hidden=\"true\">✦</span><div><p class=\"bp-callout-title\">Try the whole system for seven days</p><div class=\"bp-callout-body\"><p>Every new Pawabase organization starts with <strong>every feature, free for seven days</strong>, at the highest limits. Bring a slice of your\nSupabase schema, recreate one access rule as a policy and one edge function as a flow, and see the difference for yourself.</p></div></div></aside>\n<p><a href=\"https://dashboard.pawabase.com/signup\" target=\"_blank\" rel=\"noreferrer noopener\">Start free on Pawabase</a>, or see how Pawabase ranks against eight more platforms in\n<a href=\"https://pawabase.com/blog/best-backend-as-a-service-platforms-2026\">the 10 best backend platforms of 2026</a>.</p>",
      "image": "https://pawabase.com/blog/pawabase-vs-supabase/og.png",
      "date_published": "2026-11-11T00:00:00Z",
      "date_modified": "2026-11-11T00:00:00Z",
      "authors": [
        {
          "name": "The Pawabase team"
        }
      ],
      "tags": [
        "Comparison",
        "Supabase",
        "Postgres"
      ]
    },
    {
      "id": "https://pawabase.com/blog/build-a-saas-backend-in-an-afternoon",
      "url": "https://pawabase.com/blog/build-a-saas-backend-in-an-afternoon",
      "title": "How to build a SaaS backend in one afternoon with Pawabase",
      "summary": "Tables, access rules, sign-in, organizations, email and background jobs, then production. A step-by-step guide to a complete SaaS backend on Pawabase.",
      "content_html": "<p>Most SaaS products need the same backend, and most teams spend their first month building it: a database, an API, sign-in, teams\nand roles, invitations, transactional email, a few background jobs, and some way to tell staging from production.</p>\n<p>On Pawabase that&#x27;s an afternoon. Not a toy version of it, the real thing: the backend you&#x27;d still be happy with at your thousandth\ncustomer. In this guide we&#x27;ll build one for <strong>Taskflow</strong>, a small project-management SaaS where companies sign up, invite their\nteam, and manage projects and tasks together.</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: A timeline of the afternoon: tables at 1:00, policies at 1:40, auth at 2:20, flows at 3:10, ship at 4:00\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1600 / 640;background-image:url(&quot;data:image/webp;base64,UklGRjYAAABXRUJQVlA4ICoAAACwAgCdASoYAAoAPu1iqU2ppaOiMAgBMB2JaQAAeyAA/vCybj5irWmIoAA=&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/afternoon-D4wK5lXK.avif 640w, https://pawabase.com/assets/afternoon-CWfkgGN1.avif 960w, https://pawabase.com/assets/afternoon-DlDrJokr.avif 1280w, https://pawabase.com/assets/afternoon-rfRnKTmV.avif 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/afternoon-CFCfWcSX.webp 640w, https://pawabase.com/assets/afternoon-DNQf9BVK.webp 960w, https://pawabase.com/assets/afternoon-DPt3UxEX.webp 1280w, https://pawabase.com/assets/afternoon-CWnGbFy6.webp 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/afternoon-CGTBPE78.jpg 640w, https://pawabase.com/assets/afternoon-N-1_vZxk.jpg 960w, https://pawabase.com/assets/afternoon-DaXsywVC.jpg 1280w, https://pawabase.com/assets/afternoon-BbuBE9s-.jpg 1600w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/afternoon-BbuBE9s-.jpg\" width=\"1600\" height=\"640\" alt=\"A timeline of the afternoon: tables at 1:00, policies at 1:40, auth at 2:20, flows at 3:10, ship at 4:00\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>The plan: five steps, one system, one afternoon.</figcaption></figure>\n<p>Here&#x27;s what we&#x27;ll have by the end:</p>\n<ul>\n<li><strong>Data:</strong> projects and tasks, each belonging to a company, with an API for both.</li>\n<li><strong>Security:</strong> one access rule that keeps every company&#x27;s data its own.</li>\n<li><strong>Sign-in:</strong> email and password, passkeys and multi-factor authentication, with companies, roles and invitations.</li>\n<li><strong>Automation:</strong> a welcome email, an email when a task is assigned, and a weekly digest.</li>\n<li><strong>Production:</strong> staging and production environments, with changes promoted after a review.</li>\n</ul>\n<p>Grab a coffee. Let&#x27;s build.</p>\n<h2 id=\"100--model-the-data\">1:00 · Model the data</h2>\n<p>Create a project in <a href=\"https://dashboard.pawabase.com/signup\" target=\"_blank\" rel=\"noreferrer noopener\">Pawabase Cloud</a> and open <strong>Studio</strong>. Every project starts with a\ndevelopment environment, which is where we&#x27;ll work.</p>\n<p>In <strong>Tables</strong>, create two:</p>\n<div class=\"bp-table\"><table><thead><tr><th>Table</th><th>Columns</th></tr></thead><tbody><tr><td><code>projects</code></td><td><code>name</code> (text), <code>org_id</code> (the company it belongs to), <code>archived</code> (boolean)</td></tr><tr><td><code>tasks</code></td><td><code>title</code> (text), <code>project</code> (link to projects), <code>org_id</code>, <code>assignee</code> (a user), <code>status</code> (text), <code>due_on</code> (date)</td></tr></tbody></table></div>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Pawabase Studio&#x27;s Tables page, listing a project&#x27;s tables and the resources that serve them\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1440 / 1100;background-image:url(&quot;data:image/webp;base64,UklGRj4AAABXRUJQVlA4IDIAAAAwAwCdASoYABIAPu1qr1AppiQmqAqpMB2JaQAAOob87mAAAP7wnY5rexLNZnAR4g4AAA==&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/studio-tables-DhwGwsFA.avif 640w, https://pawabase.com/assets/studio-tables-BQg2K6xW.avif 960w, https://pawabase.com/assets/studio-tables-EfepnmaT.avif 1280w, https://pawabase.com/assets/studio-tables-DGmJrRqO.avif 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/studio-tables-5ooyoxLt.webp 640w, https://pawabase.com/assets/studio-tables-Dv_oLAko.webp 960w, https://pawabase.com/assets/studio-tables-sTav7jAC.webp 1280w, https://pawabase.com/assets/studio-tables-D825nlhT.webp 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/studio-tables-BIkaXUa-.jpg 640w, https://pawabase.com/assets/studio-tables-B87OCjAz.jpg 960w, https://pawabase.com/assets/studio-tables-Dl8S7dyg.jpg 1280w, https://pawabase.com/assets/studio-tables-CWY8a2Bk.jpg 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/studio-tables-CWY8a2Bk.jpg\" width=\"1440\" height=\"1100\" alt=\"Pawabase Studio&#x27;s Tables page, listing a project&#x27;s tables and the resources that serve them\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>Tables in Studio. Each one gets an API the moment it exists.</figcaption></figure>\n<p>That&#x27;s it for the API. Each table already has a REST endpoint with filters, relations, full-text search and pagination, and the\n<strong>API Explorer</strong> lets you try every call in the browser. Each change you make is recorded as a migration in <strong>Migration history</strong>,\nwhich you can read and roll back.</p>\n<p>Connect your front end with the SDK. Studio&#x27;s <strong>Connect</strong> button writes the setup for your framework. For a React app:</p>\n<div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">src/pawabase.ts</span><span class=\"bp-code-lang\">TypeScript</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> createClient </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">from</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;@pawabase/client&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">export</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> pawabase </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token function\" style=\"color:#ffd27a\">createClient</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\">  url</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">meta</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">env</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token constant\" style=\"color:#7fb2f0\">VITE_PAWABASE_URL</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\">  project</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">meta</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">env</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token constant\" style=\"color:#7fb2f0\">VITE_PAWABASE_PROJECT</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">6</span><span class=\"bp-lc\"><span class=\"token plain\">  apiKey</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">meta</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">env</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token constant\" style=\"color:#7fb2f0\">VITE_PAWABASE_KEY</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> </span><span class=\"token comment\" style=\"color:#77736c;font-style:italic\">// a publishable key: safe in the browser, your rules decide what it can do</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">7</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span>\n</span></span></code></pre></div>\n<p>Reading and writing is one line each:</p>\n<div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">src/tasks.ts</span><span class=\"bp-code-lang\">TypeScript</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> pawabase </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">from</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;./pawabase&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token comment\" style=\"color:#77736c;font-style:italic\">// open tasks, with their project attached</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line lit\" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> data</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> tasks </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span>\n</span></span><span class=\"bp-line lit\" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">from</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;tasks&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line lit\" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">6</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">where</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> status</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;open&quot;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line lit\" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">7</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">expand</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;project&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line lit\" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">8</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">perPage</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token number\" style=\"color:#7fb2f0\">20</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">9</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">10</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token comment\" style=\"color:#77736c;font-style:italic\">// a project, a task in it, and the task done</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">11</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> project </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">from</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;projects&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">create</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> name</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;Launch&quot;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">12</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> task </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">from</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;tasks&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">create</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> title</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;Write the launch post&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> project</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> project</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">id</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> status</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;open&quot;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">13</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">from</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;tasks&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">update</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">task</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">id</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> status</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;done&quot;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span>\n</span></span></code></pre></div>\n<aside class=\"bp-callout note\" role=\"note\"><span class=\"bp-callout-icon\" aria-hidden=\"true\">i</span><div><p class=\"bp-callout-title\">Typed from your schema</p><div class=\"bp-callout-body\"><p>Pawabase can generate TypeScript types from your tables, so <code>tasks</code> above is fully typed: the wrong column name is a compile error,\nnot a bug report.</p></div></div></aside>\n<h2 id=\"140--decide-who-may-do-what\">1:40 · Decide who may do what</h2>\n<p>A multi-tenant SaaS lives or dies on one rule: <strong>a company&#x27;s data is only ever seen by that company.</strong> Most platforms make you write\nthat rule again and again: once per table, then for files, then for realtime channels.</p>\n<p>In Pawabase you write it once. Open <strong>Policies</strong> and create one called <code>team_member</code>: <em>signed in, and a member of the organization\nthe row belongs to.</em> Then attach it:</p>\n<ul>\n<li>on <code>projects</code> and <code>tasks</code>, for reading and writing;</li>\n<li>a stricter <code>team_admin</code> (the same, with the role owner or admin) for deleting projects;</li>\n<li>on the storage bucket where task attachments live;</li>\n<li>on the realtime channels that push task updates to the board.</li>\n</ul>\n<p>That&#x27;s the whole security model of the product: two named rules, used everywhere. When you add a third table next month, you\nattach <code>team_member</code> and you&#x27;re done. Simple checks like this are pushed down into the database query, so they stay fast as your\ntables grow.</p>\n<h2 id=\"220--sign-in-companies-and-invitations\">2:20 · Sign-in, companies and invitations</h2>\n<p>Turn on the sign-in methods you want in <strong>Users &amp; auth</strong>: email and password, passkeys, and Google or GitHub. Require\nmulti-factor authentication for admins if you like. In your app:</p>\n<div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">src/auth.ts</span><span class=\"bp-code-lang\">TypeScript</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> pawabase </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">from</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;./pawabase&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">export</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">async</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">function</span><span class=\"token plain\"> </span><span class=\"token function\" style=\"color:#ffd27a\">signUp</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">email</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token builtin\" style=\"color:#ffb36b\">string</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> password</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token builtin\" style=\"color:#ffb36b\">string</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">return</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">auth</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">signUp</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> email</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> password </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">6</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">7</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">export</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">async</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">function</span><span class=\"token plain\"> </span><span class=\"token function\" style=\"color:#ffd27a\">signIn</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">email</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token builtin\" style=\"color:#ffb36b\">string</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> password</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token builtin\" style=\"color:#ffb36b\">string</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">8</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> result </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">auth</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">signInWithPassword</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> email</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> password </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">9</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token comment\" style=\"color:#77736c;font-style:italic\">// people with a second factor confirm it before the session starts</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">10</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">if</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">result</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">status </span><span class=\"token operator\" style=\"color:#FF6A00\">===</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;mfa_required&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> result</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">verify</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token function\" style=\"color:#ffd27a\">prompt</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;Your code&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token operator\" style=\"color:#FF6A00\">??</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">11</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">return</span><span class=\"token plain\"> result</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">12</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span>\n</span></span></code></pre></div>\n<p>Now the part that usually takes a week: <strong>companies</strong>. In Pawabase they&#x27;re built into authentication as <strong>organizations</strong>. Your sign-up\nflow creates the company&#x27;s organization and its creator becomes the owner; owners and admins invite colleagues by email; and a\ncompany can verify its email domain so colleagues join automatically. Roles and permissions are yours to define (owner,\nadmin, member, viewer), and a person&#x27;s organization and role travel in their session, which is exactly what the <code>team_member</code>\npolicy checks.</p>\n<p>When Taskflow&#x27;s first enterprise customer asks for <strong>single sign-on</strong>, you won&#x27;t build anything: you turn on enterprise SSO for\ntheir organization, connect their Okta, Entra ID or Google Workspace, and choose which role new people get when they first sign in.</p>\n<h2 id=\"250--attachments-and-a-live-board\">2:50 · Attachments and a live board</h2>\n<p>Two finishing touches make Taskflow feel like a real product.</p>\n<p><strong>File attachments.</strong> In <strong>Storage</strong>, create a bucket called <code>attachments</code> and give it the <code>team_member</code> policy for upload and\ndownload. Files are then one call from the browser:</p>\n<div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">src/attach.ts</span><span class=\"bp-code-lang\">TypeScript</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> pawabase </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">from</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;./pawabase&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">export</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">async</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">function</span><span class=\"token plain\"> </span><span class=\"token function\" style=\"color:#ffd27a\">attach</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">taskId</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token builtin\" style=\"color:#ffb36b\">string</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> file</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> File</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">await</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token plain\">storage</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">from</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;attachments&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token function\" style=\"color:#ffd27a\">upload</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token template-string template-punctuation string\" style=\"color:#ffd27a\">`</span><span class=\"token template-string string\" style=\"color:#ffd27a\">tasks/</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">${</span><span class=\"token template-string interpolation\" style=\"color:#ffd27a\">taskId</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token template-string string\" style=\"color:#ffd27a\">/</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">${</span><span class=\"token template-string interpolation\" style=\"color:#ffd27a\">file</span><span class=\"token template-string interpolation punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token template-string interpolation\" style=\"color:#ffd27a\">name</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token template-string template-punctuation string\" style=\"color:#ffd27a\">`</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> file</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span>\n</span></span></code></pre></div>\n<p>When you need to share a file with someone outside the company, Pawabase can make a <strong>share link</strong> that expires on its own, and\nimage attachments can be resized on the fly for thumbnails.</p>\n<p><strong>A live board.</strong> When a teammate moves a task, everyone&#x27;s board should update. Subscribe to the project&#x27;s channel; the channel&#x27;s\nrule is, of course, <code>team_member</code>:</p>\n<div class=\"bp-code\"><div class=\"bp-code-bar\"><span class=\"bp-code-title\">src/Board.tsx</span><span class=\"bp-code-lang\">TSX</span></div><pre class=\"bp-pre\" tabindex=\"0\"><code><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">1</span><span class=\"bp-lc\"><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token plain\"> </span><span class=\"token imports punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token imports\"> useEffect</span><span class=\"token imports punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token imports\"> useState </span><span class=\"token imports punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">from</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;react&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">2</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">import</span><span class=\"token plain\"> </span><span class=\"token imports punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token imports\"> pawabase </span><span class=\"token imports punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">from</span><span class=\"token plain\"> </span><span class=\"token string\" style=\"color:#ffd27a\">&quot;./pawabase&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">3</span><span class=\"bp-lc\"><span class=\"token plain\" style=\"display:inline-block\">\n</span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">4</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token keyword\" style=\"color:#FF6A00\">export</span><span class=\"token plain\"> </span><span class=\"token keyword\" style=\"color:#FF6A00\">function</span><span class=\"token plain\"> </span><span class=\"token function\" style=\"color:#ffd27a\">useBoard</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">projectId</span><span class=\"token operator\" style=\"color:#FF6A00\">:</span><span class=\"token plain\"> </span><span class=\"token builtin\" style=\"color:#ffb36b\">string</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">5</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">[</span><span class=\"token plain\">events</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> setEvents</span><span class=\"token punctuation\" style=\"color:#a8a49d\">]</span><span class=\"token plain\"> </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> </span><span class=\"token generic-function function\" style=\"color:#ffd27a\">useState</span><span class=\"token generic-function generic class-name operator\" style=\"color:#FF6A00\">&lt;</span><span class=\"token generic-function generic class-name builtin\" style=\"color:#ffb36b\">unknown</span><span class=\"token generic-function generic class-name punctuation\" style=\"color:#a8a49d\">[</span><span class=\"token generic-function generic class-name punctuation\" style=\"color:#a8a49d\">]</span><span class=\"token generic-function generic class-name operator\" style=\"color:#FF6A00\">&gt;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">[</span><span class=\"token punctuation\" style=\"color:#a8a49d\">]</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">6</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token function\" style=\"color:#ffd27a\">useEffect</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token arrow operator\" style=\"color:#FF6A00\">=&gt;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">7</span><span class=\"bp-lc\"><span class=\"token plain\">    </span><span class=\"token keyword\" style=\"color:#FF6A00\">const</span><span class=\"token plain\"> channel </span><span class=\"token operator\" style=\"color:#FF6A00\">=</span><span class=\"token plain\"> pawabase</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token property-access\">realtime</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token method function property-access\" style=\"color:#ffd27a\">channel</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token template-string template-punctuation string\" style=\"color:#ffd27a\">`</span><span class=\"token template-string string\" style=\"color:#ffd27a\">project:</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">${</span><span class=\"token template-string interpolation\" style=\"color:#ffd27a\">projectId</span><span class=\"token template-string interpolation interpolation-punctuation punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token template-string template-punctuation string\" style=\"color:#ffd27a\">`</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">8</span><span class=\"bp-lc\"><span class=\"token plain\">    channel</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token method function property-access\" style=\"color:#ffd27a\">on</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token string\" style=\"color:#ffd27a\">&quot;message&quot;</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">message</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token arrow operator\" style=\"color:#FF6A00\">=&gt;</span><span class=\"token plain\"> </span><span class=\"token function\" style=\"color:#ffd27a\">setEvents</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token plain\">all</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token arrow operator\" style=\"color:#FF6A00\">=&gt;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">[</span><span class=\"token spread operator\" style=\"color:#FF6A00\">...</span><span class=\"token plain\">all</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> message</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token property-access\">payload</span><span class=\"token punctuation\" style=\"color:#a8a49d\">]</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">9</span><span class=\"bp-lc\"><span class=\"token plain\">    channel</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token method function property-access\" style=\"color:#ffd27a\">subscribe</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">10</span><span class=\"bp-lc\"><span class=\"token plain\">    </span><span class=\"token keyword\" style=\"color:#FF6A00\">return</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token plain\"> </span><span class=\"token arrow operator\" style=\"color:#FF6A00\">=&gt;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">{</span><span class=\"token plain\"> channel</span><span class=\"token punctuation\" style=\"color:#a8a49d\">.</span><span class=\"token method function property-access\" style=\"color:#ffd27a\">unsubscribe</span><span class=\"token punctuation\" style=\"color:#a8a49d\">(</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">11</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span><span class=\"token punctuation\" style=\"color:#a8a49d\">,</span><span class=\"token plain\"> </span><span class=\"token punctuation\" style=\"color:#a8a49d\">[</span><span class=\"token plain\">projectId</span><span class=\"token punctuation\" style=\"color:#a8a49d\">]</span><span class=\"token punctuation\" style=\"color:#a8a49d\">)</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">12</span><span class=\"bp-lc\"><span class=\"token plain\">  </span><span class=\"token keyword\" style=\"color:#FF6A00\">return</span><span class=\"token plain\"> events</span><span class=\"token punctuation\" style=\"color:#a8a49d\">;</span><span class=\"token plain\"></span>\n</span></span><span class=\"bp-line \" style=\"color:#e4e0d9\"><span class=\"bp-ln\" aria-hidden=\"true\">13</span><span class=\"bp-lc\"><span class=\"token plain\"></span><span class=\"token punctuation\" style=\"color:#a8a49d\">}</span>\n</span></span></code></pre></div>\n<p>Sending is just as short: <code>channel.send(&quot;message&quot;, { task: id, status: &quot;done&quot; })</code>. In Studio&#x27;s <strong>Realtime</strong> section you can watch\nevery channel, see who is subscribed, and read the messages going through.</p>\n<h2 id=\"310--email-and-background-work-as-flows\">3:10 · Email and background work, as flows</h2>\n<p>Three pieces of logic make Taskflow feel alive. We&#x27;ll build them as <strong>flows</strong>, Pawabase&#x27;s visual workflows, so anyone on the team\ncan read them later.</p>\n<div class=\"bp-steps\"><h3 id=\"a-welcome-email\">A welcome email</h3><p>In <strong>Mail</strong>, design a <code>welcome</code> template with your logo and colours, using <code>{{ user.name }}</code> and <code>{{ org.name }}</code>. Then create a\nflow triggered by the <strong>sign-up</strong>\nevent that sends it. Every send is recorded in Mail&#x27;s history, with delivery details.</p><h3 id=\"tell-people-when-a-task-is-theirs\">Tell people when a task is theirs</h3><p>Create a flow triggered when a row in <code>tasks</code> is <strong>updated</strong> and its <code>assignee</code> changes. It reads the assignee, then sends the\n<code>task_assigned</code> email with the task&#x27;s title and a link to it. The same flow can publish to the project&#x27;s realtime channel, so the\nboard updates for everyone at once.</p><h3 id=\"a-weekly-digest\">A weekly digest</h3><p>Create a flow on a <strong>schedule</strong>, every Monday at 9:00. It finds each organization&#x27;s tasks due this week, groups them by person, and\nemails each one their list.</p></div>\n<p>Every run of every flow is recorded with its steps, inputs and output, so when someone asks &quot;why didn&#x27;t I get the email?&quot;, the answer\nis a click away. Flows run under the same policies as the rest of your backend, and they can call AI models through the gateway too,\nfor example to summarise a long task thread in the digest.</p>\n<h3 id=\"bonus-an-ai-summary\">Bonus: an AI summary</h3>\n<p>Long task threads are hard to catch up on. Connect a model provider in <strong>AI</strong>, add a chat model, and add one step to the weekly\ndigest flow: <em>summarise this person&#x27;s tasks in three sentences.</em> The model is called through Pawabase&#x27;s AI gateway, so your provider\nkey never leaves the server, and your policies decide who may use it. Later, you can make <code>tasks</code> searchable <strong>by meaning</strong>, so\n&quot;find tasks like this one&quot; works across every project.</p>\n<h3 id=\"try-it-before-you-ship\">Try it before you ship</h3>\n<p>Sign up two test users in your app, each with their own company, and add a few tasks for each. Then sign in as one and list the\ntasks, and sign in as the other and do the same. You&#x27;ll see the <code>team_member</code> policy at work: the same request, two different\nanswers, and no way to read the other company&#x27;s tasks. The <strong>API Explorer</strong> in Studio is there for everything else, to try any\nendpoint with real data while you build.</p>\n<h2 id=\"400--ship-it\">4:00 · Ship it</h2>\n<p>Everything so far happened in development. Create <strong>staging</strong> and <strong>production</strong> environments for the project. When development is\nready, <strong>promote</strong> it: Pawabase shows what will change (your tables, policies, flows and the rest of your definitions) and applies it\nafter you review. Your data stays where it is; only the definitions move.</p>\n<p>Before you invite real customers, turn on <strong>backups</strong> for production on a schedule. Each one is checked after it&#x27;s written, and a\nrestore always takes a safety copy first.</p>\n<figure class=\"bp-figure \"><button type=\"button\" class=\"bp-zoom\" aria-label=\"Open the image full size: Pawabase Studio&#x27;s overview for an environment, with requests, latency, flow runs and recent requests\"><picture class=\"bp-picture  \" style=\"aspect-ratio:1440 / 1100;background-image:url(&quot;data:image/webp;base64,UklGRjgAAABXRUJQVlA4ICwAAADwAgCdASoYABIAPu1wsFKppiSrqAgBcB2JaQAAP8h4AAD+8J3S8dLjNhQAAA==&quot;)\"><source type=\"image/avif\" srcSet=\"https://pawabase.com/assets/studio-overview-Bb800LZA.avif 640w, https://pawabase.com/assets/studio-overview-bNsfphCQ.avif 960w, https://pawabase.com/assets/studio-overview-CuedykJ0.avif 1280w, https://pawabase.com/assets/studio-overview-FeolJx3b.avif 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/webp\" srcSet=\"https://pawabase.com/assets/studio-overview-DllNhWQo.webp 640w, https://pawabase.com/assets/studio-overview-Csbs6AiM.webp 960w, https://pawabase.com/assets/studio-overview-BPgVdyS6.webp 1280w, https://pawabase.com/assets/studio-overview-BKPnNQhL.webp 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><source type=\"image/jpeg\" srcSet=\"https://pawabase.com/assets/studio-overview-DW73pwBb.jpg 640w, https://pawabase.com/assets/studio-overview-CCSPG5sF.jpg 960w, https://pawabase.com/assets/studio-overview-BKvxu2oQ.jpg 1280w, https://pawabase.com/assets/studio-overview-DupfrgjK.jpg 1440w\" sizes=\"(max-width: 760px) 100vw, 760px\"/><img src=\"https://pawabase.com/assets/studio-overview-DupfrgjK.jpg\" width=\"1440\" height=\"1100\" alt=\"Pawabase Studio&#x27;s overview for an environment, with requests, latency, flow runs and recent requests\" loading=\"lazy\" decoding=\"async\" fetchPriority=\"auto\"/></picture></button><figcaption>Production at a glance: traffic, errors, latency, flow runs and the latest requests.</figcaption></figure>\n<p>From now on, <strong>Activity</strong> shows you every request with its trace (the flows, events and jobs it caused), errors grouped by cause,\nand where your traffic comes from. Set an alarm on the error rate, and you&#x27;ll hear about a problem before your customers do.</p>\n<h2 id=\"what-we-built\">What we built</h2>\n<p>In one afternoon, without leaving one system:</p>\n<div class=\"bp-table\"><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>Data and API</td><td>Two tables with a REST API, search, relations and typed SDK access</td></tr><tr><td>Security</td><td>Two policies covering tables, files and realtime channels</td></tr><tr><td>Identity</td><td>Email, passkeys and social sign-in, MFA, organizations, roles, invitations, verified domains, ready for SSO</td></tr><tr><td>Automation</td><td>Three flows: welcome email, task assignment, weekly digest</td></tr><tr><td>Operations</td><td>Development, staging and production, a reviewed promote, verified backups, request tracing and alarms</td></tr></tbody></table></div>\n<p>No glue code between services, no second user database, no rules written five times. And when Taskflow grows, the same system\ngrows with it: more tables are an API, more logic is a flow, AI is a gateway call, and the enterprise customer is a switch.</p>\n<aside class=\"bp-callout tip\" role=\"note\"><span class=\"bp-callout-icon\" aria-hidden=\"true\">✦</span><div><p class=\"bp-callout-title\">Build it yourself</p><div class=\"bp-callout-body\"><p>New organizations get <strong>every Pawabase feature, free for seven days</strong>: SSO, the AI gateway, backups and all. That&#x27;s plenty of time to\nbuild Taskflow, or your own product.</p></div></div></aside>\n<p><a href=\"https://dashboard.pawabase.com/signup\" target=\"_blank\" rel=\"noreferrer noopener\">Start building on Pawabase</a>, follow the <a href=\"https://docs.pawabase.com\" target=\"_blank\" rel=\"noreferrer noopener\">documentation</a>, or\nread why we built it in <a href=\"https://pawabase.com/blog/introducing-pawabase\">Introducing Pawabase</a>.</p>",
      "image": "https://pawabase.com/blog/build-a-saas-backend-in-an-afternoon/og.png",
      "date_published": "2026-11-09T00:00:00Z",
      "date_modified": "2026-11-09T00:00:00Z",
      "authors": [
        {
          "name": "The Pawabase team"
        }
      ],
      "tags": [
        "Guide",
        "SaaS",
        "Backend"
      ]
    }
  ]
}
