basefyio + SolidJS: Backend for Solid Apps
SolidJS gives you fine-grained reactivity; basefyio gives it a backend. Load data with createResource and the basefyio-js SDK.
Install
npm install basefyio-jsCreate the client
// src/basefyio.ts
import { createClient } from "basefyio-js";
export const bf =createClient({
projectId: import.meta.env.VITE_BASEFYIO_PROJECT_ID,
apiKey: import.meta.env.VITE_BASEFYIO_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 { bf } from "./basefyio";
export function Posts() {
const [posts] = createResource(async () => {
const { data } = await bf.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 SQL
Real SQL and row-level security, fully portable with pg_dump.
Frequently asked questions
- Does basefyio-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 bf.auth in a context or store, and use bf.auth.onAuthStateChange to keep the current user reactive.
Other integrations
Build your SolidJS backend on basefyio
database, auth, storage, and a REST API — running in minutes.