npm package

@tacobase/client

The core tacobase SDK. Auth, database, realtime, and file storage — all in one TypeScript package with zero config.

terminal

npm install @tacobase/client

Zero-config client

createClient() reads TACOBASE_URL and TACOBASE_API_KEY from env automatically. Pass them explicitly if you prefer.

import { createClient } from '@tacobase/client'

// Zero-config
const db = createClient()

// Or explicit
const db = createClient('https://myapp.tacobase.dev', 'tbk_...')

Auth

Email/password sign-up and sign-in, OAuth, password reset, token refresh. Session is persisted automatically.

await db.auth.signUp({ email, password })
await db.auth.signIn({ email, password })
await db.auth.signInWithOAuth({ provider: 'google' })
await db.auth.requestPasswordReset(email)

const user = db.auth.user      // current user or null
const valid = db.auth.isValid  // is session still valid?
db.auth.signOut()

Database CRUD

Collections auto-create on first write. Filter, sort, paginate, and expand relations — no schema setup required.

// Create
const post = await db.collection('posts').create({
  title: 'Hello', published: true
})

// List with filter + sort
const { items, totalItems } = await db.collection('posts').getList(1, 20, {
  filter: 'published = true && author = "abc"',
  sort: '-created',
  expand: 'author',
})

// Update / delete
await db.collection('posts').update(id, { title: 'Updated' })
await db.collection('posts').delete(id)

Realtime

Subscribe to any collection and get live create/update/delete events over WebSocket.

const unsub = await db.collection('posts').subscribe((event) => {
  console.log(event.action) // 'create' | 'update' | 'delete'
  console.log(event.record) // the affected record
})

// Cleanup
await unsub()

File storage

Upload files to a collection field and get a URL back instantly.

// Get a public file URL
const url = db.storage.getFileUrl(record, 'avatar')

// Get a thumbnail
const thumb = db.storage.getFileUrl(record, 'avatar', {
  thumb: '100x100',
})

Ready to build?

Get credentials from the dashboard or spin up an instant project in one command.