Install, configure, and use the official client SDK.
npm install @hirall/client # or pnpm add @hirall/client
import { createClient } from '@hirall/client';
export const hirall = createClient(
process.env.NEXT_PUBLIC_HIRALL_URL!,
process.env.NEXT_PUBLIC_HIRALL_ANON_KEY!,
);// Sign up
await hirall.auth.signUp('user@example.com', 'password123');
// Sign in
const session = await hirall.auth.signIn('user@example.com', 'password123');
// Sign out
await hirall.auth.signOut();// Upload a file
const uploadResult = await hirall.storage
.bucket('avatars')
.upload('user1.png', file);
// Download a file
const fileBlob = await hirall.storage
.bucket('avatars')
.download('user1.png');