Installation
How to install Zagora
Zagora works with any StandardSchema-compliant validator like Zod, Valibot, or ArkType.
Install Zagora
bun
bun add zagoraInstall a Validator
You'll need a StandardSchema-compliant validation library. Choose one:
Zod
bun add zodVerify Installation
Create a simple procedure to verify everything works:
import { z } from 'zod';
import { zagora } from 'zagora';
const greet = zagora()
.input(z.string())
.handler((_, name) => `Hello, ${name}!`)
.callable();
const result = greet('World');
console.log(result);
// { ok: true, data: 'Hello, World!', error: undefined }TypeScript Configuration
Zagora is written in TypeScript and provides full type inference out of the box. No additional configuration is required, but ensure your tsconfig.json has strict mode enabled for the best experience:
{
"compilerOptions": {
"strict": true,
"moduleResolution": "bundler"
}
}Next Steps
Now that you have Zagora installed, check out the Quick Start guide to build your first procedure.