Skip to content

SDK reference

Everything an app can call: entity, auth, forms, notifyOwner, email, files, ai, pdf, fn, prefs and asset, with signatures and return values.

Last updated September 17, 2026

On this page

Every app imports the SDK from @praxivara/sdk. It is managed by the platform and updated for you; the file is read-only in the Code tab.

JavaScript
import { entity, auth, forms, notifyOwner, email, files, ai, pdf, fn, prefs, asset } from "@praxivara/sdk";

entity(name)

CallReturns
list({ limit, offset, sort, mine })Array of rows, newest first
filter(conditions, options)Array of rows. Conditions: { field: value } or { field: { op, value } } with op eq, ne, lt, lte, gt, gte, contains
get(id)One row
create(data)The created row
bulkCreate(rows)The created rows
update(id, data)The updated row (merge)
delete(id), remove(id), archive(id)Soft delete
bulkUpdate([{ id, ...fields }])The updated rows
updateMany(ids, data)Same change to many rows
deleteMany(ids)Soft delete many
subscribe(callback, options)Calls back with fresh rows as they change; returns a stop function
schema()The table's fields and permissions

Rows carry id, created_date, mine and, for signed-in readers, created_by.

auth

CallNotes
isSignedIn()Synchronous boolean
methods(){ email, google }: which sign-in methods are on
register(email, password, displayName)Creates the account and signs in
login(email, password)
loginWithGoogle({ returnTo })Leaves for Google; returns signed in
googleSignInResult()null, or { ok, user } / { ok: false, error, message } after a Google round-trip
logout()
me()null when signed out; else { id, email, display_name, role, status, data, created_date }
updateMyUserData({ display_name, data })The signed-in user edits their own profile
forgotPassword(email)Always returns the same message
resetPassword(token, newPassword)Token from the reset link; signs in
listUsers(), inviteUser({ email, role, message }), setUserRole(id, role), setUserStatus(id, status)Admin only

forms

forms.submit(name, values) sends an intake form. Works signed out. Throws with err.fields (a field-to-message map) on validation failure.

notifyOwner and email

CallNotes
notifyOwner(subject, message)Emails the app owner. Works signed out
email.send({ to, subject, body, replyTo })Sends from the app to a recipient. Caller must be signed in

files

CallReturns
files.upload({ file }){ file_url, name, size, content_type }
files.createSignedUrl({ file_url, expires_in }){ signed_url }

ai

CallReturns
ai.invokeLLM({ prompt, response_json_schema, add_context_from_internet, file_urls })A string, or parsed JSON when a schema is given
ai.generateImage({ prompt, size }){ url } (wrap with asset())
ai.extractDataFromUploadedFile({ file_url, json_schema }){ output }

pdf

pdf.render(html, name) returns { url }; mint a signed link before using it.

fn

fn.invoke(name, payload) runs a backend function and returns whatever it returned. Throws on failure.

prefs and asset

CallNotes
prefs.get(key), prefs.set(key, value)Remember something on the device: a theme, a filter, a draft
asset(path)The full address of a file the app ships with, such as a generated image

Sessions in pages

From @/lib/session.jsx: useSession() gives { status, user, isSignedIn, isAdmin, refresh, signOut }; <RequireAuth roles="admin"> guards a page; <RedirectIfSignedIn to="/dashboard"> wraps login and register.

Errors

Every call throws on failure with err.status and err.message. 401 means sign in first; 403 means not allowed; 402 means the call could not be paid for, so show the message rather than retrying.

Was this page helpful?