<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Clients on back(d)</title><link>https://fernandezvara.github.io/backd/docs/build/clients/</link><description>Recent content in Clients on back(d)</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://fernandezvara.github.io/backd/docs/build/clients/index.xml" rel="self" type="application/rss+xml"/><item><title>JavaScript client</title><link>https://fernandezvara.github.io/backd/docs/build/clients/js/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://fernandezvara.github.io/backd/docs/build/clients/js/</guid><description>&lt;p&gt;&lt;code&gt;backd-js&lt;/code&gt; is a small JavaScript library for &lt;code&gt;backd&lt;/code&gt;. It is plain ES modules with no dependencies and no build step, and it runs wherever &lt;code&gt;fetch&lt;/code&gt; does: browsers, Node 20+, Deno, Bun and edge runtimes. It ships TypeScript declarations, so editors autocomplete it in JavaScript and TypeScript projects alike.&lt;/p&gt;
&lt;h2 id="install"&gt;Install&lt;a class="hd-anchor" href="#install" aria-hidden="true"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;npm install backd-js
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It has no dependencies, needs no build step and works with any bundler. Without one, import it in a browser with an &lt;a href="https://developer.mozilla.org/docs/Web/HTML/Element/script/type/importmap"&gt;import map&lt;/a&gt; pointing at the package&amp;rsquo;s &lt;code&gt;src/index.js&lt;/code&gt; (from a CDN such as &lt;code&gt;https://cdn.jsdelivr.net/npm/backd-js/src/index.js&lt;/code&gt;, or from your own server), as the &lt;a href="#example-app"&gt;example app&lt;/a&gt; does.&lt;/p&gt;</description></item><item><title>Dart client</title><link>https://fernandezvara.github.io/backd/docs/build/clients/dart/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://fernandezvara.github.io/backd/docs/build/clients/dart/</guid><description>&lt;p&gt;&lt;code&gt;backd&lt;/code&gt; is a hand-written Dart client for &lt;code&gt;backd&lt;/code&gt;, published on pub.dev as &lt;a href="https://pub.dev/packages/backd"&gt;&lt;code&gt;package:backd&lt;/code&gt;&lt;/a&gt;. It is pure Dart — &lt;code&gt;dart:io&lt;/code&gt; does the transport — so it runs in Flutter apps &lt;strong&gt;and&lt;/strong&gt; in standalone Dart programs (CLIs, daemons, server-side Dart), exactly like &lt;code&gt;backd-js&lt;/code&gt; runs in browsers and Node alike.&lt;/p&gt;
&lt;aside class="hd-hint hd-hint--warning"&gt;
 &lt;p class="hd-hint-title"&gt;&lt;i class="ph ph-warning hd-icon" aria-hidden="true"&gt;&lt;/i&gt;
No admin API, by design&lt;/p&gt;
 The Dart client has &lt;strong&gt;no admin API&lt;/strong&gt;. Administration is for the operator&amp;rsquo;s own tooling — the CLI, the admin UI and functions — all JavaScript, all server-side or operator-run. A client application holding admin capability is a footgun: the key that unlocks it (a &lt;code&gt;bdk_…&lt;/code&gt; API key with the &lt;code&gt;admin&lt;/code&gt; role, full realm access) must never ship in an app. A Dart program that truly needs the admin API calls &lt;a href="../../../operate/administration/admin/"&gt;the REST endpoints&lt;/a&gt; directly, knowingly.
&lt;/aside&gt;

&lt;h2 id="install"&gt;Install&lt;a class="hd-anchor" href="#install" aria-hidden="true"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dart pub add backd &lt;span class="c1"&gt;# or: flutter pub add backd&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The package&amp;rsquo;s only dependencies are Dart-team packages (&lt;code&gt;crypto&lt;/code&gt; for file checksums); SSE and multipart are parsed by hand. It needs a &lt;code&gt;dart:io&lt;/code&gt; platform — Flutter mobile and desktop, and standalone Dart. Flutter web is not supported yet (streaming responses need a &lt;code&gt;package:web&lt;/code&gt; transport, which is a planned follow-up).&lt;/p&gt;</description></item><item><title>Generated types</title><link>https://fernandezvara.github.io/backd/docs/build/clients/types/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://fernandezvara.github.io/backd/docs/build/clients/types/</guid><description>&lt;p&gt;A realm&amp;rsquo;s config already describes its API: collections and their schemas, functions and their inputs, app configuration, templates and roles. &lt;code&gt;backd types&lt;/code&gt; turns it into one TypeScript file — or one Dart file, with &lt;code&gt;--lang dart&lt;/code&gt; — so editors and compilers know what the API holds. Nothing is checked at runtime from the generated types; the server validates every request regardless.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;CONFIG_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;./config backd types --realm shop --out src/backd
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# wrote src/backd/types.d.ts and src/backd/realm.json (types 3f9a0c61d2b7e485)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;CONFIG_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;./config backd types --realm shop --lang dart --out lib/backd
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# wrote lib/backd/types.dart and lib/backd/realm.json (types 3f9a0c61d2b7e485)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The fingerprint is the same for both languages: they describe the same realm.&lt;/p&gt;</description></item></channel></rss>