Kolaybase + SolidJS: Backend for Solid Apps
SolidJS gives you fine-grained reactivity; Kolaybase gives it a backend. Load data with createResource and the kolaybase-js SDK.
Install
npm install kolaybase-jsCreate the client
// src/kolaybase.ts
import { createClient } from "kolaybase-js";
export const kb = createClient({
projectId: import.meta.env.VITE_KOLAYBASE_PROJECT_ID,
apiKey: import.meta.env.VITE_KOLAYBASE_ANON_KEY,
});Use the anon key in the browser; row-level security enforces access at the database.
Load data with a resource
import { createResource, For } from "solid-js";
import { kb } from "./kolaybase";
export function Posts() {
const [posts] = createResource(async () => {
const { data } = await kb.from("posts").select("id, title");
return data ?? [];
});
return <ul><For each={posts()}>{(p) => <li>{p.title}</li>}</For></ul>;
}Works with resources
createResource pairs naturally with async SDK calls for data fetching.
Full backend included
Database, auth, and storage in one SDK.
Standard PostgreSQL
Real SQL and row-level security, fully portable with pg_dump.
Frequently asked questions
- Does kolaybase-js work with SolidStart?
- Yes. SolidStart supports server and client code, and the SDK runs in both. Use the anon key on the client and a service key only in server functions.
- How do I handle auth in SolidJS?
- Wrap kb.auth in a context or store, and use kb.auth.onAuthStateChange to keep the current user reactive.
Other integrations
Build your SolidJS backend on Kolaybase
PostgreSQL, auth, storage, and a REST API — running in minutes.