Back to gallery
danielroe/airspace on GitHub — The database you already have.
danielroe
Built bydanielroe/

airspace

The database you already have.

Stars
172
Forks
6
Watchers
172
Open issues
12
TypeScriptMIT main Updated 1 hour ago~2 stars/day lifetime
Editor's take

airspace is a typed TypeScript client that treats your atproto (Bluesky) personal data server as your app's database, CMS, login and file storage. It matters because a small content site can skip running a database: records live in your own repo under your own schema, and switching hosts keeps your data intact. You define lexicons once and get typed records, joins and OAuth scopes, with examples for Nuxt, Astro, SvelteKit and plain Node. Tradeoffs: drafts and private records rely on permissioned spaces, which are experimental and do not work on hosted PDSes like bsky.social yet. Everything you write is public by default. Built by Daniel Roe, who leads Nuxt. MIT, about 170 stars.

Use this if

You are building a personal blog or small content site and like the idea of owning data on atproto.

Skip if

You need private data, relational queries or Indian data residency; Supabase or Postgres is the better fit.

CMS & ContentDatabase & ORM
Topics
atprotoblueskycmslexiconpdspermissioned-spacestypescript
Quick install
# Install via npm / pnpm / bun:
pnpm add airspace
# or
npm install airspace

Inferred from TypeScript · always double-check against the official README below.

README — rendered from danielroe/airspace

airspace

npm version npm downloads Github Actions Codecov

The database you already have.

getair.space

Every Bluesky atmosphere account comes with a personal data server: a cms, login, file storage and a public API that you own.

  • you own your data. Records live in your own repo under your own schema. Switch tools or hosts – or even stop using airspace – and everything still works.
  • no database to run. Reads, writes, auth and images are all handled by your own PDS. airspace is a typed client.
  • drafts built in. Experimental permissioned spaces for private data, with a single call to publish.
  • typed from your schema. Define the model once. Records, keys, joins and OAuth scopes are inferred magically. ✨

example

// lexicons.ts
import { defineLexicons, field } from 'airspace/lexicon'

export default defineLexicons('dev.roe', {
  note: {
    title: field.text(),
    body: field.markdown(),
    createdAt: field.datetime(),
  },
})
// notes.ts
import { createAirspace, defineCollection, passwordSession } from 'airspace'
import lexicons from './lexicons.ts'

const notes = defineCollection(lexicons.note)

export const airspace = createAirspace({
  identity: 'roe.dev',
  collections: { notes },
  session: await passwordSession({ service: 'https://pds.example', identifier: 'roe.dev', password: process.env.PDS_APP_PASSWORD! }),
})

const published = await airspace.notes.list({ limit: 10 })
await airspace.notes.create({ title: 'Hello', body: '# hi', createdAt: new Date().toISOString() })

Warning

Permissioned spaces, where drafts and private records live, are experimental. They need a PDS running prerelease software: atproto's permissioned-data branch, or the @atproto/pds spaces alpha. Hosted PDSes, including bsky.social, do not support them yet. The API may change.

docs

getair.space/docs.

examples

  • examples/nuxt: a Nitro plugin providing an airspace client + server routes +@comark/vue.
  • examples/astro: static generation + getStaticPaths + Astro actions for writing.
  • examples/sveltekit: load functions + form actions with field-level validation.
  • examples/node: a CLI with no framework and no build step.

The demo on getair.space is the same app, running against a sandbox account on a demo PDS.

development

  • Clone this repository
  • Install dependencies with pnpm install
  • Run the tests with pnpm dev. They run against a real PDS with permissioned spaces, booted in process with @atproto/dev-env
  • Run pnpm dev:pds for a PDS on port 2583 that stays up, printing dotenv-shaped credentials for two accounts
  • Run pnpm lex:build to regenerate src/lex from lexicons/
  • Run pnpm size to print the bundle size table in the docs

credits

Many thanks to @mkrl for the name idea 🙏

license

Made with ❤️

Published under MIT License.

Live data via GitHub REST API · Cached 30 min · Created 11 Sept 2026