<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Pawabase Blog</title>
    <link>https://pawabase.com/blog</link>
    <atom:link href="https://pawabase.com/blog/rss.xml" rel="self" type="application/rss+xml"/>
    <description>Product updates, engineering notes and guides from the people building Pawabase.</description>
    <language>en</language>
    <image><url>https://pawabase.com/icon-512.png</url><title>Pawabase Blog</title><link>https://pawabase.com/blog</link></image>
    <lastBuildDate>Mon, 16 Nov 2026 00:00:00 GMT</lastBuildDate>
    <item>
      <title>Call any AI model from your app without exposing your keys</title>
      <link>https://pawabase.com/blog/call-ai-models-without-exposing-your-keys</link>
      <guid isPermaLink="true">https://pawabase.com/blog/call-ai-models-without-exposing-your-keys</guid>
      <pubDate>Mon, 16 Nov 2026 00:00:00 GMT</pubDate>
      <description>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.</description>
      <dc:creator>The Pawabase team</dc:creator>
      <category>AI</category>
      <category>Product</category>
      <category>Security</category>
      <content:encoded><![CDATA[<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
build of a mobile app, in a repository that was public for one afternoon. Scrapers look for these keys all day, and the first sign
that one was found is usually the bill.</p>
<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,
and the fastest way puts the key where the code runs. The safe way, a server in between, has always meant building, securing and
running one more thing, usually on a deadline.</p>
<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
you connect. The provider keys stay on the server, your access rules decide who may call each model, and every call is recorded with
who made it and what it cost.</p>
<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>
<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,
drafts replies, finds similar past tickets and hands the hard ones to an agent, without one provider key on a user&#x27;s device.</p>
<h2 id="the-proxy-everyone-ends-up-writing">The proxy everyone ends up writing</h2>
<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
endpoint that holds the key and forwards a prompt. Then it grows:</p>
<ul>
<li><strong>Authentication</strong>, because the endpoint is on the internet, and anyone who finds it can spend your money.</li>
<li><strong>Rules</strong>, because free users should get the small model and only admins should get the expensive one.</li>
<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
know who it was.</li>
<li><strong>Streaming</strong>, because nobody wants to stare at a spinner for twelve seconds while a model writes a paragraph.</li>
<li><strong>A wrapper for each provider</strong>, because each API is slightly different, and switching from one to another means a rewrite.</li>
<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>
</ul>
<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
costs real money. The AI gateway is that whole proxy, built into the backend your app already uses.</p>
<h2 id="meet-the-ai-gateway">Meet the AI gateway</h2>
<h3 id="connect-a-provider-once">Connect a provider once</h3>
<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
the 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
never travels to a browser, a phone or a log.</p>
<p>You keep your own account with each provider, so you pay them directly at their prices. Pawabase never marks up your tokens.</p>
<h3 id="expose-models-under-your-own-names">Expose models under your own names</h3>
<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
classifications, <code>embed</code> for search. Your app calls the name, never the vendor&#x27;s model ID.</p>
<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
every 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
provider to another the same way, because the gateway speaks one format to your app and translates for each provider behind it.</p>
<p>Each name can also carry:</p>
<ul>
<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
every 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>
<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>
is on one provider and its fallback is on another, a provider&#x27;s bad afternoon never reaches your users.</li>
<li><strong>Prices</strong>: the model&#x27;s input and output prices, so Studio can show you what every call cost.</li>
</ul>
<h3 id="decide-who-may-call-each-model">Decide who may call each model</h3>
<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
nothing new to learn and nothing to keep in sync.</p>
<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
organization, 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
<code>reasoning</code> model is limited to your paid plan.</p>
<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
sign-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
never sees the request, and you&#x27;re never billed for it.</p>
<h3 id="call-it-from-your-app">Call it from your app</h3>
<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
safe 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
asking.</p>
<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>
</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">
</span>
</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>
</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>
</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>
</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>
</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>
</span></span></code></pre></div>
<p>That&#x27;s the whole setup. Now let&#x27;s build something with it.</p>
<h2 id="build-it-an-ai-support-inbox">Build it: an AI support inbox</h2>
<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
things, each in a few lines of code:</p>
<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
text:</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>
</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>
</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>
</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>
</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>
</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></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
entirely, 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
iterator 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>
</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>
</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">
</span>
</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>
</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>
</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">
</span>
</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>
</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>
</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>
</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>
</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>
</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>
</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">
</span>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
returns 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>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
</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">
</span>
</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>
</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>
</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
change 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
<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
model. Pawabase fills in vectors for the rows you already have and keeps them current as tickets arrive. Then &quot;find things like this&quot;
is 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>
</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>
</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>
</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>
</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>
</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>
</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
no way for a search to show someone a ticket their policy hides.</p></div>
<p>Four features, no server code, no provider key on any device. Every call is checked against your rules and recorded.</p>
<h2 id="hand-the-hard-ones-to-an-agent">Hand the hard ones to an agent</h2>
<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
then <em>do</em> something. That&#x27;s what <strong>agents</strong> are for.</p>
<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
Studio, choose its model from the gateway, and decide which actions need a person&#x27;s approval. When it reaches one of those actions,
it stops and waits.</p>
<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>
</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">
</span>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
</span></span></code></pre></div>
<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
could. It can never do more than the rules allow, however the prompt is worded. You can also stream a run step by step with
<code>ai.agents.stream</code>, and give agents your help docs as a knowledge base that your app can search directly:</p>
<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>
</span></span></code></pre></div>
<h2 id="see-every-call-and-what-it-cost">See every call, and what it cost</h2>
<p>Because every call goes through the gateway, every call is visible. In Studio, the AI section shows usage over any period, and the
recent calls list shows each request: which model, which provider answered, how long it took, how many tokens it used, what it cost,
and <strong>who</strong> made it, whether a signed-in user or a key.</p>
<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>
<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
to dig through a provider dashboard that only knows your key.</p>
<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
real provider behind it.</p>
<h2 id="what-this-changes">What this changes</h2>
<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
it and what it cost. And you can switch models or providers without shipping a new version of your app.</p></div></div></aside>
<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>
<p><strong>For cost</strong>, the expensive model sits behind a rule, refused requests never reach your provider, and every call carries a price
and a name.</p>
<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>
<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
doesn&#x27;t have to.</p>
<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
it.</p>
<h2 id="questions-we-hear">Questions we hear</h2>
<h3 id="is-the-publishable-key-really-safe-to-ship">Is the publishable key really safe to ship?</h3>
<p>Yes. It identifies your environment but grants nothing on its own. What each request may do is decided by your policies and the
person&#x27;s sign-in, and by default a new model is closed to everything except your servers.</p>
<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>
<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
search over your own tables. If your app already signs people in with Pawabase, the gateway knows who is calling with no extra work.</p>
<h3 id="what-happens-when-a-provider-is-down">What happens when a provider is down?</h3>
<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.
Without a fallback, your app gets a clear error it can show.</p>
<h3 id="can-i-bring-a-model-the-list-doesnt-name">Can I bring a model the list doesn&#x27;t name?</h3>
<p>Yes. Any service that speaks the OpenAI API can be connected, including open models you host yourself.</p>
<h3 id="does-pawabase-charge-for-tokens">Does Pawabase charge for tokens?</h3>
<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
cost.</p>
<h2 id="get-started">Get started</h2>
<ol>
<li>Open <strong>AI</strong> in Studio and connect a provider.</li>
<li>Expose a model under a name, like <code>chat</code>, and choose who may call it.</li>
<li>Call <code>pawabase.ai.chat(&quot;chat&quot;, …)</code> from your app.</li>
</ol>
<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
free for seven days</strong>, so you can build your AI feature end to end before you decide anything.</p>
<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>]]></content:encoded>
    </item>
    <item>
      <title>Introducing Pawabase: the complete backend for anything you build</title>
      <link>https://pawabase.com/blog/introducing-pawabase</link>
      <guid isPermaLink="true">https://pawabase.com/blog/introducing-pawabase</guid>
      <pubDate>Sun, 15 Nov 2026 00:00:00 GMT</pubDate>
      <description>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.</description>
      <dc:creator>The Pawabase team</dc:creator>
      <category>Announcement</category>
      <category>Product</category>
      <category>Backend</category>
      <content:encoded><![CDATA[<p>Every product ends up needing the same backend. A database. An API in front of it. Sign-in, and then organizations, roles and
invitations the week after. Somewhere to put files. Background jobs. Email that doesn&#x27;t look like it came from 2009. Rules for who
may 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>
<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>
<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,
already working together, from the first table of a weekend project to the backend a company runs its business on.</p>
<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>
<h2 id="the-problem-with-assembling-a-backend">The problem with assembling a backend</h2>
<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
third. A queue service for background work, an email provider plus a template tool, an automation product for the workflows, an AI
provider whose keys end up in three different codebases, and a log vendor to tell you which of the other seven is broken.</p>
<p>Each one is good at its job. Together they&#x27;re a liability:</p>
<ul>
<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
of who&#x27;s allowed to do what. Keeping them in agreement is a project of its own.</li>
<li><strong>Eight bills and eight dashboards.</strong> Cost becomes impossible to predict, and an incident becomes a tour of tabs.</li>
<li><strong>Glue code that nobody owns.</strong> Webhooks between services, retries around flaky calls, a cron job that syncs two things that should
never have been separate.</li>
<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,
your realtime channel and your workflow tool, each in its own language. One of them is always wrong.</li>
</ul>
<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>
<p>We built Pawabase because we were tired of paying that tax, and we think you are too.</p>
<h2 id="what-pawabase-is">What Pawabase is</h2>
<p>Pawabase is one backend system built on Postgres. Every part of it shares the same database, the same users and the same rules.
You 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
Cloud</strong> with environments, backups and full visibility built in.</p>
<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>
<p>Here&#x27;s what you get, on day one, in every project.</p>
<h3 id="data-and-apis">Data and APIs</h3>
<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
filtering, relations, full-text search and pagination, documented in an API explorer you can try right in the browser. Your schema
changes are migrations with a history you can read, and roll back when you need to.</p>
<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>
</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">
</span>
</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>
</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>
</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>
</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>
</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>
</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>
</span></span></code></pre></div>
<p>Pawabase works with whatever you build your front end in. Typed SDKs for TypeScript and Python, and setup guides (with your keys
already filled in) for the frameworks you already use:</p>
<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>
<h3 id="authentication-that-grows-with-you">Authentication that grows with you</h3>
<p>Email and password, passkeys, social and custom sign-in providers, multi-factor authentication, sessions and devices you can see and
revoke. Then the part every B2B product needs and nobody wants to build: <strong>organizations</strong> for your users, with roles, permissions,
teams, verified domains, seats and invitations. When an enterprise customer asks for single sign-on, you turn on <strong>enterprise SSO</strong>
(SAML or OpenID Connect) for their organization, with just-in-time provisioning. You don&#x27;t spend a quarter building it.</p>
<p>Services and AI agents get identities of their own too: <strong>machine identities</strong> with their own keys and access, so an integration
never has to borrow a person&#x27;s account.</p>
<h3 id="access-policies-one-rule-everywhere">Access policies: one rule, everywhere</h3>
<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
is accepted: tables, files, realtime channels, flows and routes. &quot;A member of this organization&quot; is defined in one place and
enforced in every one of them. Change it once and every part changes with it. Where it can, Pawabase pushes the check down into the
database query itself, so a rule never means &quot;fetch everything, then filter&quot;.</p>
<h3 id="storage-realtime-and-email">Storage, realtime and email</h3>
<p><strong>Storage</strong> gives every project buckets with per-action rules (who may upload, download, list or delete), share links that expire
on their own, and image resizing on the fly. <strong>Realtime</strong> gives you channels with presence, durable message history and live
queries that update a list the moment its data changes. <strong>Mail</strong> gives you a visual template editor, variables, sent-mail history
and delivery insight, so a password reset or an invoice email looks like your brand, not like a default.</p>
<h3 id="flows-and-background-work">Flows and background work</h3>
<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.
A flow can be triggered by an HTTP route, an event in your data, a schedule, an inbound webhook, a realtime message or another
flow. Under them sit durable <strong>queues</strong> with retries, <strong>schedules</strong> with cron or intervals, and signed <strong>webhooks</strong> in and out.
The logic that usually ends up scattered across serverless functions and automation tools lives in one place you can read.</p>
<h3 id="ai-built-in-not-bolted-on">AI built in, not bolted on</h3>
<p>Pawabase includes an <strong>AI gateway</strong>: one OpenAI-compatible address for every model you connect, with your provider keys kept on the
server and your access rules deciding who may call which model. On top of it, <strong>agents</strong> that can use your tables, flows,
documents and connected apps, and wait for a person&#x27;s approval when they should. Any table can be made searchable <strong>by meaning</strong>
with vector fields, so &quot;find tickets like this one&quot; is a single call.</p>
<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>
<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
an <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
and build tables and flows with you, and anything permanent asks first.</p>
<h3 id="operations-handled">Operations, handled</h3>
<p>Every project has <strong>environments</strong>: development, staging, production. Changes move between them through a reviewed <strong>promote</strong>, and
API 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
request with its trace, the flows and events it caused, errors grouped by cause, latency and bandwidth, a map of where requests
come from, and alarms when something drifts. <strong>Backups</strong> are taken on your schedule, checked after they&#x27;re written, and restorable
in a click, with a safety copy taken before any restore.</p>
<h2 id="how-we-built-it-four-principles">How we built it: four principles</h2>
<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>
<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
to know who someone is, it asks the same place. When a rule changes, it changes everywhere. This is the difference between a backend
and a pile of integrations.</p>
<p><strong>2. Complete, then composable.</strong> The parts work together from day one, so a new project already has sign-in, organizations, email
and 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
want more control.</p>
<p><strong>3. Make it visible.</strong> Clear states and useful errors beat magic that disappears when something breaks. Every request is traced,
every flow run is recorded step by step, every email has a history, and every backup is checked. When something goes wrong at 2am,
the answer is a click away, not a hunch.</p>
<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
team to run. Pawabase handles the operational work (environments, promotes, backups, alarms) so a small team can sell to large
customers without becoming an infrastructure department.</p>
<h2 id="who-pawabase-is-for">Who Pawabase is for</h2>
<p><strong>Solo developers and indie hackers.</strong> Ship a real product on a weekend without stitching services together. The free plan carries
a prototype, and when it takes off, the same system scales with it.</p>
<p><strong>Startups.</strong> Get to market with the backend you&#x27;d otherwise spend your first quarter building: organizations, roles, email,
background jobs and AI, ready from the first commit. When your first enterprise customer asks for single sign-on, say yes.</p>
<p><strong>Agencies and studios.</strong> Build client products on one system you know inside out, with a project per client, environments for
review, and a Studio clients can actually use.</p>
<p><strong>Product teams at growing companies.</strong> Replace the tangle of services behind your internal tools and products with one backend
your whole team can see and safely work from.</p>
<h2 id="built-for-teams-not-just-for-code">Built for teams, not just for code</h2>
<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.
A founder wants to know why signups dropped yesterday. In most stacks, each of those means a ticket to an engineer.</p>
<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
the activity they need, and the same policies that protect your API decide what they can see and change. Your backend becomes
the shared system a team works from, not a black box only one person understands.</p>
<h2 id="start-free-with-every-feature-for-seven-days">Start free, with every feature for seven days</h2>
<p>Pawabase Cloud has a free plan for prototypes, experiments and learning the platform, and paid plans priced by what you use:
projects, database size, users and traffic. Not by which features you&#x27;re allowed to have.</p>
<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
something real on the whole system before you decide anything.</p></div></div></aside>
<p>Then pick the plan that fits. Starter adds backups, data export and full request details; Pro adds the AI gateway, organizations,
machine identities and bot protection; Business adds enterprise SSO. Your data and projects stay yours on every plan.</p>
<h2 id="questions-people-ask-us">Questions people ask us</h2>
<h3 id="is-pawabase-a-backend-as-a-service">Is Pawabase a backend-as-a-service?</h3>
<p>It does everything a backend-as-a-service does (database, API, auth, storage, realtime) and keeps going: organizations for your
users, access policies shared across every part, visual workflows, transactional email, an AI gateway and agents, environments,
tracing and backups. We think of it as the complete backend, the system your product and your team both work from.</p>
<h3 id="do-i-have-to-use-the-visual-tools">Do I have to use the visual tools?</h3>
<p>No. Everything you build in Studio is also available through the API and the SDKs, and your app talks to Pawabase through clean
REST endpoints and typed clients for TypeScript and Python, with setup guides for React, Next.js, Vue, Svelte, Angular, Flutter,
iOS, Android and more. Use Studio where it&#x27;s faster, code where you prefer it.</p>
<h3 id="is-my-data-locked-in">Is my data locked in?</h3>
<p>Your data lives in Postgres, the most widely used open database there is. Paid plans include data export and backups you can
download, so your data is never trapped.</p>
<h3 id="what-does-it-cost">What does it cost?</h3>
<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
you use. See <a href="https://pawabase.com/pricing">pricing</a> for the details.</p>
<h2 id="whats-next">What&#x27;s next</h2>
<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,
more AI connectors, richer insights, and more of the boring operational details handled before you have to think about them.</p>
<p>If you&#x27;ve ever spent a sprint wiring services together instead of shipping your product, Pawabase is for you.</p>
<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
blog. We&#x27;ll be writing about what we ship and how it works.</p>]]></content:encoded>
    </item>
    <item>
      <title>The 10 best backend-as-a-service platforms of 2026</title>
      <link>https://pawabase.com/blog/best-backend-as-a-service-platforms-2026</link>
      <guid isPermaLink="true">https://pawabase.com/blog/best-backend-as-a-service-platforms-2026</guid>
      <pubDate>Fri, 13 Nov 2026 00:00:00 GMT</pubDate>
      <description>We ranked the leading BaaS platforms of 2026 on completeness, access control, automation, AI readiness and operations. Here is who wins, and why.</description>
      <dc:creator>The Pawabase team</dc:creator>
      <category>Comparison</category>
      <category>Backend</category>
      <category>BaaS</category>
      <content:encoded><![CDATA[<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
product team makes. The platform you pick decides how you handle sign-in and organizations, where your business logic lives, how
you call AI models without leaking keys, how you see what&#x27;s happening in production, and how much glue code your team will maintain
for the next five years.</p>
<p>The market has never been more crowded. There are open-source platforms you run yourself, managed services from the cloud giants,
reactive databases, single-binary backends and no-code API builders. Each one is excellent at something. Very few are excellent at
the thing that matters most once a product is real: carrying the whole backend, not just the database.</p>
<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
past 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
shines, because the right choice depends on what you&#x27;re building.</p>
<h2 id="how-we-scored-them">How we scored them</h2>
<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
how much they matter once a product is real:</p>
<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>
<ul>
<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
API, auth, organizations for your customers, storage, realtime, jobs, email and workflows. Every gap is a vendor to add and glue
to maintain.</li>
<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
alike. Most security incidents in young products are access rules that disagree with each other.</li>
<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>
<li><strong>Automation (15%).</strong> Background jobs, schedules, webhooks, transactional email and business workflows: the logic that makes a
product feel alive.</li>
<li><strong>AI readiness (10%).</strong> Calling models without exposing keys, rules on who may call which model, agents, search by meaning, and
tooling for AI coding assistants.</li>
<li><strong>Operations (10%).</strong> Environments, safe releases, logs and traces, backups and restores you&#x27;ve actually tested.</li>
<li><strong>Price and lock-in (10%).</strong> Predictable pricing as you grow, and how hard it would be to leave.</li>
</ul>
<p>We judged each platform, from its documented features, against the same brief: a multi-tenant SaaS with organizations, roles,
file uploads, a live-updating board, a few transactional emails, a nightly job and an AI-powered summary. The question for each was
simple: <em>how much of that does the platform carry, and how much do you build?</em></p>
<h2 id="the-ranking-at-a-glance">The ranking at a glance</h2>
<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>
<p>Now the details.</p>
<h2 id="1-pawabase">1. Pawabase</h2>
<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>
<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
enterprises.</p>
<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
part (the data API, authentication, access policies, storage, realtime, visual flows, background jobs, email, the AI gateway and
agents, observability and backups) shares one Postgres database, one set of users and one set of rules. That single design decision
is why it wins almost every category in our rubric.</p>
<p>On <strong>completeness</strong>, nothing else comes close. Organizations for your customers, with roles, permissions, teams, invitations,
verified domains and seats, are built into authentication, not a weekend of custom tables. Transactional email has a visual template
editor, variables and sent-mail history. Business logic lives in visual <strong>flows</strong> that anyone on the team can read, triggered by
HTTP routes, data events, schedules, inbound webhooks or realtime messages. Every item in our SaaS brief is covered without adding another service.</p>
<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
organization&quot; once and attach it to tables, files, realtime channels, flows and routes. Every other platform here makes you express
the same rule separately for each kind of resource, often in a different language for each. Pawabase also pushes simple checks
down into the database query, so security never costs you a full table scan.</p>
<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
access 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>
on any table, and an <strong>MCP server</strong> that gives each AI coding assistant a key scoped to exactly what it may touch.</p>
<p>On <strong>operations</strong>, every project gets development, staging and production environments, a reviewed <strong>promote</strong> between them, API
versions that run side by side, request tracing that shows the flows and events each request caused, alarms, and <strong>backups</strong> that
are verified after they&#x27;re written.</p>
<p><strong>Standout features</strong></p>
<ul>
<li>One access model for tables, files, channels, flows and routes</li>
<li>Organizations, roles, teams, invitations and enterprise SSO for your customers, built in</li>
<li>Visual flows, queues, schedules and signed webhooks</li>
<li>Transactional email with a template editor and history</li>
<li>AI gateway, agents, vector search and an MCP server</li>
<li>Environments, promote, tracing, alarms and verified backups</li>
</ul>
<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
you need far fewer community packages, because the parts are already there.</p>
<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
rather spend your time on the product than on its backend. Every new organization gets every feature free for seven days.</p>
<h2 id="2-supabase">2. Supabase</h2>
<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>
<p><strong>Best for:</strong> developers who love Postgres and want a strong set of primitives to build on.</p>
<p>Supabase deserves its popularity. It gives you a hosted Postgres database with an auto-generated REST and GraphQL API,
authentication with many providers, file storage, realtime, edge functions written in TypeScript, vector support, cron and queues,
database branching, a capable dashboard, and the option to self-host. Its community and ecosystem are among the largest of any
platform here, and its documentation is excellent.</p>
<p>Where it trails Pawabase against our brief is in what you assemble yourself. Access control is written as Postgres row-level security,
in SQL, table by table, and again for storage and realtime. Organizations, roles and invitations for your customers are up to you
to model. Business workflows mean writing and deploying edge functions, and transactional email beyond sign-in messages means
wiring 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>
<p><strong>Standout features</strong></p>
<ul>
<li>Real Postgres with row-level security</li>
<li>REST and GraphQL APIs, realtime and storage</li>
<li>Edge functions, cron, queues and vectors</li>
<li>Open source and self-hostable, with a big community</li>
</ul>
<p><strong>Trade-offs:</strong> more of the product backend is yours to build: access rules in SQL per table, organizations, workflows, email.</p>
<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
<a href="https://pawabase.com/blog/pawabase-vs-supabase">Pawabase vs Supabase</a>.</p>
<h2 id="3-firebase">3. Firebase</h2>
<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>
<p><strong>Best for:</strong> mobile apps that also want Google&#x27;s analytics, messaging and crash reporting.</p>
<p>Firebase remains a powerhouse for mobile. Firestore&#x27;s realtime sync, offline support and polished client SDKs are excellent, and
the surrounding products (push messaging, remote config, crash reporting, analytics, hosting) are hard to beat if you live in
Google&#x27;s ecosystem. Data Connect has also brought a Postgres option into the family for teams that need relational data.</p>
<p>The trade-offs are well known. Firestore is a document database, so relational data, joins and reporting take careful design and
often duplication. Its security rules are a language of their own. Costs that follow document reads and writes can surprise a
growing app, and moving off Google Cloud later is a real project.</p>
<p><strong>Standout features</strong></p>
<ul>
<li>Realtime sync and offline support on mobile</li>
<li>Push messaging, remote config, analytics and crash reporting</li>
<li>Massive scale on Google&#x27;s infrastructure</li>
</ul>
<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>
<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>
<h2 id="4-convex">4. Convex</h2>
<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>
<p><strong>Best for:</strong> TypeScript teams building highly reactive, collaborative apps.</p>
<p>Convex rethinks the backend as TypeScript functions on top of a reactive database. Queries keep the UI up to date automatically
when data changes, mutations are transactional, and scheduled functions and file storage are built in. For collaborative,
live-updating apps it&#x27;s a genuinely joyful developer experience, and its type safety from database to UI is first class.</p>
<p>Its strength is also its constraint: everything is code. Access rules, workflows and integrations are functions you write and
maintain, and the data model is Convex&#x27;s own rather than standard SQL, which matters for reporting and portability.</p>
<p><strong>Standout features</strong></p>
<ul>
<li>Reactivity by default, end to end</li>
<li>Transactional TypeScript functions with strong typing</li>
<li>Scheduled functions and file storage</li>
</ul>
<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>
<p><strong>Pick it if</strong> your product is fundamentally a live, collaborative interface and your team is all-in on TypeScript.</p>
<h2 id="5-appwrite">5. Appwrite</h2>
<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>
<p><strong>Best for:</strong> teams that want an open-source backend they can run themselves.</p>
<p>Appwrite offers databases, authentication, storage, functions in many languages, messaging (email, SMS and push), realtime and
hosting, 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
is active and welcoming.</p>
<p>Its database API is document-style rather than raw SQL, which keeps simple apps simple but makes relational modelling and reporting
harder. More advanced product needs, such as shared access patterns, business workflows and AI, are left to your functions.</p>
<p><strong>Standout features</strong></p>
<ul>
<li>Open source and self-hostable</li>
<li>A broad feature set, including messaging</li>
<li>Functions in many runtimes</li>
</ul>
<p><strong>Trade-offs:</strong> a document-style data API; workflows and AI are your code.</p>
<p><strong>Pick it if</strong> running your backend on your own infrastructure is a hard requirement.</p>
<h2 id="6-aws-amplify">6. AWS Amplify</h2>
<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>
<p><strong>Best for:</strong> teams already standardised on AWS.</p>
<p>Amplify wraps AWS services (Cognito for auth, AppSync for a GraphQL API, DynamoDB for data, S3 for files and Lambda for logic)
behind a TypeScript-first developer experience. If your company runs on AWS, it keeps everything inside the same account,
compliance boundary and bill, and gives you the full depth of AWS when you need it.</p>
<p>The cost is complexity. Your backend is many AWS services working together, and when something goes wrong you&#x27;re debugging the
underlying services, their permissions and their limits. For a small team, the learning curve is steep.</p>
<p><strong>Standout features</strong></p>
<ul>
<li>The full power, scale and compliance story of AWS</li>
<li>TypeScript-first backend definitions</li>
</ul>
<p><strong>Trade-offs:</strong> complexity; many moving AWS parts to understand; AWS lock-in.</p>
<p><strong>Pick it if</strong> your organization has already chosen AWS for everything and has the people to run it.</p>
<h2 id="7-pocketbase">7. PocketBase</h2>
<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>
<p><strong>Best for:</strong> small apps, internal tools and prototypes.</p>
<p>PocketBase is a single executable that gives you a SQLite database, authentication, file storage, realtime subscriptions and an
admin dashboard. It&#x27;s remarkably capable for its size, starts in seconds, and extending it with Go or JavaScript hooks is
straightforward. For a side project or an internal tool, it&#x27;s hard to beat on simplicity.</p>
<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>
<p><strong>Standout features</strong></p>
<ul>
<li>One file to deploy; fast and lightweight</li>
<li>Auth, files, realtime and an admin UI included</li>
<li>Open source and easy to extend</li>
</ul>
<p><strong>Trade-offs:</strong> single-node by design; operations and growth are yours to manage.</p>
<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>
<h2 id="8-nhost">8. Nhost</h2>
<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>
<p><strong>Best for:</strong> GraphQL-first teams who want Postgres.</p>
<p>Nhost combines Postgres with Hasura&#x27;s GraphQL engine, plus authentication, storage and serverless functions. If your front end
speaks GraphQL, it&#x27;s a natural fit: your schema becomes a GraphQL API instantly, and Hasura&#x27;s permission system is expressive.</p>
<p>Teams that don&#x27;t want GraphQL get less from it, and like most platforms here, business workflows, transactional email and AI are
left to your functions.</p>
<p><strong>Standout features</strong></p>
<ul>
<li>Instant GraphQL on Postgres</li>
<li>Hasura&#x27;s permission system</li>
<li>Open source</li>
</ul>
<p><strong>Trade-offs:</strong> GraphQL-centric; workflows, email and AI are your code.</p>
<p><strong>Pick it if</strong> GraphQL is your team&#x27;s default and you want it on Postgres with minimal setup.</p>
<h2 id="9-xano">9. Xano</h2>
<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>
<p><strong>Best for:</strong> no-code and low-code builders who need a real backend.</p>
<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
logic, authentication and integrations. It pairs well with no-code front-end tools and has helped a lot of non-developers ship
real products.</p>
<p>Developers who prefer code-first workflows, typed SDKs and standard tooling may find it limiting, and its visual builder is focused
on APIs rather than the full set of product backend needs.</p>
<p><strong>Standout features</strong></p>
<ul>
<li>Visual API building</li>
<li>Approachable for non-developers</li>
</ul>
<p><strong>Trade-offs:</strong> less suited to code-first teams; a narrower backend scope.</p>
<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
one place, Pawabase&#x27;s flows give you both.</p>
<h2 id="10-back4app">10. Back4App</h2>
<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>
<p><strong>Best for:</strong> teams running apps built on Parse Server.</p>
<p>Back4App hosts the open-source Parse Server, with REST and GraphQL APIs, cloud code and a dashboard. For teams with existing Parse
apps, it&#x27;s a well-trodden path that keeps them running without managing servers.</p>
<p>For new projects, the Parse model shows its age next to the platforms above, particularly around modern auth, access control and
AI.</p>
<p><strong>Standout features</strong></p>
<ul>
<li>Managed Parse Server</li>
<li>A mature API surface</li>
</ul>
<p><strong>Trade-offs:</strong> an older platform model; fewer modern features for new products.</p>
<p><strong>Pick it if</strong> you already have a Parse app and want it hosted.</p>
<h2 id="the-patterns-behind-the-ranking">The patterns behind the ranking</h2>
<p>Looking across all ten, three patterns decided most of the ranking.</p>
<p><strong>Primitives aren&#x27;t products.</strong> Most platforms here give you excellent building blocks (a database, an API, auth, functions) and
leave the product backend to you. The gap between &quot;we have auth&quot; and &quot;our customers have organizations, roles, invitations and
SSO&quot; is months of work. Platforms that close that gap win.</p>
<p><strong>Rules that live in one place are rules that stay correct.</strong> When access rules are written separately for tables, files,
realtime and logic, they drift apart, and drifting rules are how data leaks. A single access model across every part is the most
underrated feature in this category.</p>
<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
backend is where keys must live, where rules must apply, and where agents get their tools. Platforms that treat AI as a first-class
part of the backend are pulling ahead.</p>
<h2 id="frequently-asked-questions">Frequently asked questions</h2>
<h3 id="what-is-a-backend-as-a-service">What is a backend-as-a-service?</h3>
<p>A backend-as-a-service (BaaS) gives you the server side of an app (a database, an API, authentication, file storage and usually
realtime) as a managed service, so you don&#x27;t build and run those parts yourself. The best platforms in 2026 go further, with access
control, background jobs, workflows, email and AI.</p>
<h3 id="which-baas-is-best-for-a-saas-product">Which BaaS is best for a SaaS product?</h3>
<p>For a SaaS, the deciding features are organizations and roles for your customers, one access model for every part of the backend,
business workflows and enterprise SSO. Pawabase is the only platform on this list with all of them built in, which is why it ranks
first for SaaS.</p>
<h3 id="which-baas-is-best-for-ai-apps">Which BaaS is best for AI apps?</h3>
<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
search by meaning over your own data. Pawabase covers all three with its AI gateway, policies and vector fields, and adds agents and
an MCP server on top.</p>
<h3 id="is-postgres-better-than-a-document-database-for-a-baas">Is Postgres better than a document database for a BaaS?</h3>
<p>For most products, yes. Relational data, reporting, joins and constraints come naturally in Postgres, and it keeps your data
portable. Pawabase, Supabase and Nhost are Postgres-based; Firebase and Appwrite use document-style data models for most of their
platforms.</p>
<h3 id="can-i-switch-backends-later">Can I switch backends later?</h3>
<p>You can, but it gets more expensive every month, because your access rules, logic and integrations are written against the platform
you chose. That&#x27;s the strongest argument for choosing a complete system early.</p>
<h2 id="how-to-choose">How to choose</h2>
<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
for the next sixty.</strong> Every service you add is another set of users to sync, another rule to keep in agreement, another bill and
another dashboard during an incident.</p>
<ul>
<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
system, including organizations, enterprise SSO, workflows and AI, without the assembly.</li>
<li>Want <strong>Postgres primitives</strong> and enjoy building the rest yourself? Supabase is a strong choice.</li>
<li>Building a <strong>mobile app</strong> deep in Google&#x27;s ecosystem? Firebase.</li>
<li>Building something <strong>highly reactive in TypeScript</strong>? Convex.</li>
<li>Need to <strong>self-host open source</strong>? Appwrite or PocketBase, depending on scale.</li>
<li>Standardised on <strong>AWS</strong>? Amplify.</li>
</ul>
<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
product on it, organizations, access rules and a flow or two, and compare that to what it takes anywhere else.</p></div></div></aside>
<p><a href="https://dashboard.pawabase.com/signup" target="_blank" rel="noreferrer noopener">Start free on Pawabase</a>, or read our deeper comparison of
<a href="https://pawabase.com/blog/pawabase-vs-supabase">Pawabase and Supabase</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Pawabase vs Supabase: which backend should you build on in 2026?</title>
      <link>https://pawabase.com/blog/pawabase-vs-supabase</link>
      <guid isPermaLink="true">https://pawabase.com/blog/pawabase-vs-supabase</guid>
      <pubDate>Wed, 11 Nov 2026 00:00:00 GMT</pubDate>
      <description>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.</description>
      <dc:creator>The Pawabase team</dc:creator>
      <category>Comparison</category>
      <category>Supabase</category>
      <category>Postgres</category>
      <content:encoded><![CDATA[<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
platform that made &quot;Postgres with an API&quot; mainstream. And Pawabase, the complete backend built on Postgres for products that are
meant to become businesses.</p>
<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
API for every table, authentication, storage and realtime. The difference is everything that comes after: <strong>Supabase gives you
excellent primitives and leaves the product backend for you to assemble. Pawabase gives you that product backend, already built.</strong></p>
<p>Here&#x27;s what that means in practice.</p>
<h2 id="the-short-version">The short version</h2>
<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>
<p>Both are good platforms. The question is how much of your product&#x27;s backend you want to build yourself.</p>
<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>
<h2 id="access-control-one-rule-or-one-rule-per-table">Access control: one rule, or one rule per table</h2>
<p>This is the biggest difference between the two, and the one you&#x27;ll feel every week.</p>
<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
as SQL, table by table. Here&#x27;s the classic &quot;members of an organization may read its orders&quot; rule:</p>
<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>
</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>
</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>
</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>
</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>
</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>
</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>
</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></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>
</span></span></code></pre></div>
<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
policies. Then for realtime channels. A real product has dozens of tables, and every one needs its rules written, reviewed and kept
in 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
them all.</p>
<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
a rule is accepted: tables (with separate rules for read, write and delete), files, realtime channels, flows and routes.</p>
<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>
<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
the database query, so it never means &quot;load everything, then filter&quot;, and Studio shows each policy in plain language, so the
person reviewing access doesn&#x27;t need to read SQL.</p>
<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>
<h2 id="organizations-for-your-users">Organizations for your users</h2>
<p>Almost every B2B product needs the same thing: users belong to organizations, organizations have roles and permissions, people are
invited, some customers verify their email domain so colleagues join automatically, and eventually someone pays for seats.</p>
<p><strong>Supabase</strong> gives you excellent authentication for individual users and leaves the organization model to you. That means designing
membership tables, roles and invitations, writing RLS that understands them, building the invitation emails and flows, and
maintaining it all.</p>
<p><strong>Pawabase</strong> has organizations built into authentication: roles and permissions, teams, invitations, verified domains, seats and
organization-level multi-factor requirements. Organization membership and role travel in the user&#x27;s session, so your policies can
check them directly. When your first enterprise customer asks for single sign-on, you turn on <strong>enterprise SSO</strong> for their
organization, with SAML or OpenID Connect and just-in-time role assignment, instead of starting a project.</p>
<h2 id="business-logic-visual-flows-or-functions-you-deploy">Business logic: visual flows, or functions you deploy</h2>
<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,
update stock, notify the warehouse and email a receipt. Every night, find abandoned carts and send a reminder.</p>
<p><strong>Supabase</strong> handles this with edge functions, written in TypeScript and deployed separately, plus cron and queues to trigger them.
It&#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>
<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
call AI models. A flow can be triggered by an HTTP route, a data event, a schedule, an inbound webhook, a realtime message or another
flow. 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
what happened and why.</p>
<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>
<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
email didn&#x27;t go out. Developers can still drop into code when they want to, through routes and the API.</p>
<h2 id="email-thats-part-of-the-product">Email that&#x27;s part of the product</h2>
<p>Transactional email is one of those things that&#x27;s &quot;just an integration&quot; until you need branded templates, variables, previews,
a history of what was sent and why something bounced.</p>
<p><strong>Supabase</strong> sends its authentication emails (sign-up confirmations, magic links, password resets) through a default sender or
the SMTP server you configure. For everything else, receipts, notifications and invitations, you bring an email provider and build
the templates and sending logic yourself.</p>
<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
API, sent-mail history and delivery insight. Projects that don&#x27;t have a provider yet can start on Pawabase&#x27;s own sender.</p>
<h2 id="ai-a-gateway-and-agents-not-just-vectors">AI: a gateway and agents, not just vectors</h2>
<p>Both platforms support vector search on Postgres, and both offer an MCP server so AI coding assistants can work with your backend.</p>
<p>Pawabase goes further in your product itself. Its <strong>AI gateway</strong> gives your app one OpenAI-compatible address for every model you
connect. Your provider keys stay on the server, and your policies decide who may call which model. That&#x27;s the difference between
&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
for 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
anything permanent asks first.</p>
<h2 id="operations-and-visibility">Operations and visibility</h2>
<p><strong>Supabase</strong> offers branching for preview environments, logs and reports in its dashboard, and backups on its paid plans.</p>
<p><strong>Pawabase</strong> gives every project development, staging and production <strong>environments</strong>, with changes moving through a reviewed
<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
together with the flows, events and jobs it caused, groups errors by cause, maps where requests come from, and raises alarms when
something drifts. <strong>Backups</strong> are checked after they&#x27;re written and restored with a safety copy taken first.</p>
<h2 id="developer-experience">Developer experience</h2>
<p>Both platforms have a good dashboard and good SDKs, so this comes down to what you spend your day doing.</p>
<p>On <strong>Supabase</strong>, much of your day is in SQL and code: designing tables, writing row-level security, writing and deploying edge
functions, and connecting the services around them. Its dashboard is a capable window onto Postgres, and its client libraries are
mature.</p>
<p>On <strong>Pawabase</strong>, <strong>Studio</strong> is where the whole backend is built and run. Tables, policies, sign-in, organizations, flows, email
templates, AI models and agents, environments, backups and live activity all live in one place, with a command search to jump
anywhere. The <strong>API Explorer</strong> lets you try every endpoint with real data. The <strong>Connect</strong> panel writes the setup for your framework
(React, Next.js, Vue, Svelte, Angular, Astro, Flutter, iOS, Android, Node, Python and more) and your package manager, with the right
keys 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>
<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
understand what happens when an order is paid, and support can find a customer and see their recent activity, all under the same
rules that protect your API.</p>
<h2 id="realtime-and-storage">Realtime and storage</h2>
<p>Both platforms do realtime and file storage well, with different emphases.</p>
<p><strong>Realtime.</strong> Supabase offers broadcast, presence and database change streams. Pawabase offers channels with presence, durable
message 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
data changes. Its channel rules use the same policies as everything else, so &quot;members of this organization may subscribe&quot; is the
same <code>team_member</code> rule you already wrote. Studio shows every channel, who is subscribed and what was sent.</p>
<p><strong>Storage.</strong> Both give you buckets, access rules and image transformations. Pawabase adds per-action rules (upload, download, list
and delete can each have their own policy), share links that expire on their own, and profile pictures for your users handled for
you.</p>
<h2 id="pricing-approach">Pricing approach</h2>
<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
is the approach.</p>
<p>Pawabase prices by what you use: projects, database size, users and traffic. There&#x27;s a free plan for prototypes, every feature free
for seven days for new organizations, and paid plans from there. The features that cost Pawabase real money to provide, like
backups, data export and full request details, start on Starter, and team, AI and enterprise features on higher plans. You never
need a second vendor to fill a gap, which is where most backend bills actually grow.</p>
<h2 id="where-supabase-is-the-better-fit">Where Supabase is the better fit</h2>
<p>We&#x27;ll be straight about it. Supabase is a great choice if:</p>
<ul>
<li>you want to <strong>self-host</strong> an open-source platform today;</li>
<li>your team enjoys writing <strong>SQL and row-level security</strong> and wants to stay as close to raw Postgres as possible;</li>
<li>you need <strong>GraphQL</strong> out of the box;</li>
<li>your app is mostly CRUD and you don&#x27;t expect to need organizations, workflows, email or an AI gateway.</li>
</ul>
<h2 id="where-pawabase-wins">Where Pawabase wins</h2>
<p>Pawabase is the better fit when you&#x27;re building a <strong>product meant to become a business</strong>:</p>
<ul>
<li>a <strong>SaaS or B2B app</strong> that needs organizations, roles, invitations and, eventually, enterprise SSO;</li>
<li>a product with real <strong>business logic</strong> that you want visible and maintainable, not scattered across functions;</li>
<li>a team that wants <strong>one access model</strong> for data, files, channels and logic;</li>
<li>anyone adding <strong>AI</strong> who wants keys on the server and rules on every call;</li>
<li>teams that want <strong>environments, tracing and backups</strong> handled from day one.</li>
</ul>
<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>
<h2 id="frequently-asked-questions">Frequently asked questions</h2>
<h3 id="is-pawabase-a-supabase-alternative">Is Pawabase a Supabase alternative?</h3>
<p>Yes. Both are Postgres-based backend platforms with an API for every table, auth, storage and realtime. Pawabase adds what you
would otherwise build on top of Supabase: shared access policies, organizations for your users, visual flows, transactional email,
an AI gateway and agents.</p>
<h3 id="which-is-easier-to-secure">Which is easier to secure?</h3>
<p>Pawabase. With row-level security you write and review SQL policies table by table, and again for storage and realtime. With
Pawabase you write named policies once and attach them everywhere, and Studio shows each one in plain language.</p>
<h3 id="which-is-better-for-b2b-saas">Which is better for B2B SaaS?</h3>
<p>Pawabase, because organizations, roles, invitations, verified domains, seats and enterprise SSO for your customers are built in.
On Supabase, that model is yours to design and maintain.</p>
<h3 id="can-i-use-both">Can I use both?</h3>
<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
system for the product backend.</p>
<h2 id="moving-from-supabase-to-pawabase">Moving from Supabase to Pawabase</h2>
<p>Because both run on Postgres, a move is a translation, not a rewrite. Here&#x27;s the path we recommend.</p>
<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
types, 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
group becomes one named policy in Pawabase, attached to every table, bucket and channel that used it. Most teams end up with a
handful 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
organizations, 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
anything genuinely custom as a route. Every run is now recorded with its steps, which makes the first week after a migration much
calmer.</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
environment. When everything passes, promote to production.</p></div>
<p>What you gain is everything you&#x27;d otherwise have kept building yourself: one access model, organizations, flows, email, an AI
gateway, environments and tracing.</p>
<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
Supabase 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>
<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
<a href="https://pawabase.com/blog/best-backend-as-a-service-platforms-2026">the 10 best backend platforms of 2026</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>How to build a SaaS backend in one afternoon with Pawabase</title>
      <link>https://pawabase.com/blog/build-a-saas-backend-in-an-afternoon</link>
      <guid isPermaLink="true">https://pawabase.com/blog/build-a-saas-backend-in-an-afternoon</guid>
      <pubDate>Mon, 09 Nov 2026 00:00:00 GMT</pubDate>
      <description>Tables, access rules, sign-in, organizations, email and background jobs, then production. A step-by-step guide to a complete SaaS backend on Pawabase.</description>
      <dc:creator>The Pawabase team</dc:creator>
      <category>Guide</category>
      <category>SaaS</category>
      <category>Backend</category>
      <content:encoded><![CDATA[<p>Most SaaS products need the same backend, and most teams spend their first month building it: a database, an API, sign-in, teams
and roles, invitations, transactional email, a few background jobs, and some way to tell staging from production.</p>
<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
customer. In this guide we&#x27;ll build one for <strong>Taskflow</strong>, a small project-management SaaS where companies sign up, invite their
team, and manage projects and tasks together.</p>
<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>
<p>Here&#x27;s what we&#x27;ll have by the end:</p>
<ul>
<li><strong>Data:</strong> projects and tasks, each belonging to a company, with an API for both.</li>
<li><strong>Security:</strong> one access rule that keeps every company&#x27;s data its own.</li>
<li><strong>Sign-in:</strong> email and password, passkeys and multi-factor authentication, with companies, roles and invitations.</li>
<li><strong>Automation:</strong> a welcome email, an email when a task is assigned, and a weekly digest.</li>
<li><strong>Production:</strong> staging and production environments, with changes promoted after a review.</li>
</ul>
<p>Grab a coffee. Let&#x27;s build.</p>
<h2 id="100--model-the-data">1:00 · Model the data</h2>
<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
development environment, which is where we&#x27;ll work.</p>
<p>In <strong>Tables</strong>, create two:</p>
<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>
<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>
<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
<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>,
which you can read and roll back.</p>
<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>
<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>
</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">
</span>
</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>
</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>
</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>
</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>
</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>
</span></span></code></pre></div>
<p>Reading and writing is one line each:</p>
<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>
</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">
</span>
</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>
</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>
</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>
</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>
</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>
</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>
</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">
</span>
</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>
</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>
</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>
</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>
</span></span></code></pre></div>
<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,
not a bug report.</p></div></div></aside>
<h2 id="140--decide-who-may-do-what">1:40 · Decide who may do what</h2>
<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
that rule again and again: once per table, then for files, then for realtime channels.</p>
<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
the row belongs to.</em> Then attach it:</p>
<ul>
<li>on <code>projects</code> and <code>tasks</code>, for reading and writing;</li>
<li>a stricter <code>team_admin</code> (the same, with the role owner or admin) for deleting projects;</li>
<li>on the storage bucket where task attachments live;</li>
<li>on the realtime channels that push task updates to the board.</li>
</ul>
<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
attach <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
tables grow.</p>
<h2 id="220--sign-in-companies-and-invitations">2:20 · Sign-in, companies and invitations</h2>
<p>Turn on the sign-in methods you want in <strong>Users &amp; auth</strong>: email and password, passkeys, and Google or GitHub. Require
multi-factor authentication for admins if you like. In your app:</p>
<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>
</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">
</span>
</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>
</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>
</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>
</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">
</span>
</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>
</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>
</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>
</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>
</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>
</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></span></code></pre></div>
<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
flow creates the company&#x27;s organization and its creator becomes the owner; owners and admins invite colleagues by email; and a
company can verify its email domain so colleagues join automatically. Roles and permissions are yours to define (owner,
admin, member, viewer), and a person&#x27;s organization and role travel in their session, which is exactly what the <code>team_member</code>
policy checks.</p>
<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
their organization, connect their Okta, Entra ID or Google Workspace, and choose which role new people get when they first sign in.</p>
<h2 id="250--attachments-and-a-live-board">2:50 · Attachments and a live board</h2>
<p>Two finishing touches make Taskflow feel like a real product.</p>
<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
download. Files are then one call from the browser:</p>
<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>
</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">
</span>
</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>
</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>
</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></span></code></pre></div>
<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
image attachments can be resized on the fly for thumbnails.</p>
<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
rule is, of course, <code>team_member</code>:</p>
<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>
</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>
</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">
</span>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
</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>
</span></span></code></pre></div>
<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
every channel, see who is subscribed, and read the messages going through.</p>
<h2 id="310--email-and-background-work-as-flows">3:10 · Email and background work, as flows</h2>
<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
can read them later.</p>
<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
flow triggered by the <strong>sign-up</strong>
event 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
<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
board 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
emails each one their list.</p></div>
<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
is 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,
for example to summarise a long task thread in the digest.</p>
<h3 id="bonus-an-ai-summary">Bonus: an AI summary</h3>
<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
digest 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
key 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
&quot;find tasks like this one&quot; works across every project.</p>
<h3 id="try-it-before-you-ship">Try it before you ship</h3>
<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
tasks, 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
answers, 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
endpoint with real data while you build.</p>
<h2 id="400--ship-it">4:00 · Ship it</h2>
<p>Everything so far happened in development. Create <strong>staging</strong> and <strong>production</strong> environments for the project. When development is
ready, <strong>promote</strong> it: Pawabase shows what will change (your tables, policies, flows and the rest of your definitions) and applies it
after you review. Your data stays where it is; only the definitions move.</p>
<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
restore always takes a safety copy first.</p>
<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>
<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,
and 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>
<h2 id="what-we-built">What we built</h2>
<p>In one afternoon, without leaving one system:</p>
<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>
<p>No glue code between services, no second user database, no rules written five times. And when Taskflow grows, the same system
grows 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>
<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
build Taskflow, or your own product.</p></div></div></aside>
<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
read why we built it in <a href="https://pawabase.com/blog/introducing-pawabase">Introducing Pawabase</a>.</p>]]></content:encoded>
    </item>
  </channel>
</rss>
