HIRALL SDK

Install, configure, and use the official client SDK.

Install

npm install @hirall/client
# or
pnpm add @hirall/client

Initialize client

import { createClient } from '@hirall/client';

export const hirall = createClient(
  process.env.NEXT_PUBLIC_HIRALL_URL!,
  process.env.NEXT_PUBLIC_HIRALL_ANON_KEY!,
);

Auth examples

// 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();

Storage examples

// 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');