Backends
Backends
A backend is a Postgres database with auth, file storage and functions in front of it. Your code reaches all of it through the @pherwerz/cloud client.
Install the client
terminal
npm install @pherwerz/cloudIt runs in browsers, Node 20+, Deno, Bun and edge runtimes, with no runtime dependencies.
Create a client
Find your backend's API URL and publishable key under API & keys on the backend's page.
lib/phz.ts
import { createClient } from '@pherwerz/cloud';
export const phz = createClient(
'https://api-<ref>.pherwerz.app',
'phz_pk_…' // publishable key: safe in the browser
);Every method returns { data, error }; API errors are returned, not thrown.