Browser SDK & more
August 30, 2023
In Space you can build a personal app for yourself, and you can see it run for just about anyone in the world with an internet connection. No need to consider sign-in, sign-up, users, or data separation. The power of auth on the personal cloud is… not thinking about auth. Because it just works.
However, when building a personal app, you need to create an entire backend, writing APIs that routed user requests in the browser and back to the data in Deta Base or Deta Drive. That means a whole lot of drudgery and clients having to go through a backend Micro to store and retrieve data. It also adds latency to user actions as they waited on a backend Micro to respond (cough cough, cold starts).
From today, not only can you forget about auth, but you can forget about entire backends. With the new Deta Browser SDK you can now use Base or Drive straight from your browser.
Read on to discover how you can start living backend free with the Deta Browser SDK.
Or import it into your app from Space’s CDN:
The SDK will auto-detect if it is running in Space and on the browser, where you can start reading and writing data:
On Space, it will just work. No need for keys or a backend, just low-latency personal applications. Check out this repo for an example app that uses the new SDK on the client.
Deta Team member and author of PingBack, Maxu, had this to say after getting his hands on an early release:
“Some ppl. try to avoid writing API routes and use React & Next.JS server components. I avoid both with the Browser SDK. Instant 10x.”
Checkout this tutorial from Deta CEO, Mustafa, using the Browser SDK to build a full app in a stingle HTML file:
A few notes:
- The Browser SDK supports all the same methods and features as the existing SDK
- The Browser SDK will not work on public Micros or Public Routes
- The SDK will continue to work on a backend (it auto-detects if it is in a browser)
After persistent requests and hacky hacks, we’re pleased to share that you can now sort your Base items by ascending or descending key order. Simply pass a desc value to any Fetch call (docs).
This works in the browser with the new SDK ;)
If you check the key column in any Base UI view, you’ll also notice a toggle that gives you the same ability.
We now have support asynchronous interactions with Deta Base in the Python SDK. See the “Python (async)” tab in the docs for more.
detalibfrom the JS SDK, which was causing a lot of errors: more
- Pushed an error message fix in JS SDK: more
- Fixed wrong exit code in the CLI: more
- Fixed build failures when a top level directory conflicts with .spaceignore: more
- Added a default Serve field to the Spacefile generated for static micros: more
- Fixed a bug where the build pipeline fails to zip static micros