Quickstart
Go from zero to your first authenticated query in a few minutes.
1. Get your keys
In your project dashboard, copy the project URL (https://<project>.ichibase.net) and the publishable (anon) key (ich_pub_…). The anon key is safe to embed in client apps — access is controlled by your row-level security policies, not by hiding the key. Never ship the ich_admin_ (service) key to a client.
2. Install & create a client
npm install @ichibase/client
// lib/ichibase.ts
import { createClient } from '@ichibase/client';
export const ichi = createClient(
process.env.NEXT_PUBLIC_ICHIBASE_URL!,
process.env.NEXT_PUBLIC_ICHIBASE_ANON_KEY!,
);3. Read & write data
// Read
const { data } = await ichi.from('posts').select('*').eq('published', true);
// Write
await ichi.from('posts').insert({ title: 'Hello world' });4. Sign a user in
await ichi.auth.login({ email, password });
// From here, data calls run AS this user — your RLS sees auth.uid().
await ichi.from('posts').insert({ title: 'mine' });Building a web app? Add your origin (e.g.
http://localhost:5173) in your project's Settings → CORS first, or the browser will block requests. Native apps (React Native, Flutter) are unaffected.