Turn messy JSON into
your schema. Safely.
AI proposes the mapping, FOON enforces the schema. Transform inconsistent webhook payloads and API responses into strict TypeScript types.
$ npm install foon-sdk
added 1 package in 1.2s
$ node transform.js
> Transformed in 245ms (confidence: 0.97)
Output validated against schema successfully.
The Problem You Know Too Well
External data is messy. Your types are strict. Something has to give.
Incoming Data
{
"fullName": "Jane Smith",
"email_addr": "jane@...",
"signup_date": "2024-01..."
}
Every webhook, every API, every vendor has their own naming conventions.
FOON
transforms
Your Schema
{
"name": {
"given": "Jane",
"family": "Smith"
},
"email": "jane@...",
"createdAt": "2024-01..."
}
Type-safe. Validated. Predictable.
FOON uses AI to understand field semantics, but the actual transformation is deterministic and validated against your JSON Schema. No hallucinations in your production data.
See It In Action
Select an example and watch FOON transform messy input into your target schema.
{
"fullName": "Jane Smith",
"email_addr": "jane.smith@example.com",
"phone_number": "+1-555-123-4567",
"signup_date": "2024-01-15T10:30:00Z"
}// Click 'Transform' to see the result
How It Works
Four steps from chaos to order. AI assists, but never controls.
Input
Pass any JSON payload and your target JSON Schema to FOON.
AI Mapping Plan
AI analyzes field semantics and generates a mapping plan with confidence scores.
Deterministic Transform
The mapping plan executes deterministically. Same input, same output, every time.
Schema Validation
Output is validated against your schema. Invalid data throws, never passes through.
Clean, Simple API
Drop FOON into your existing codebase with minimal changes.
import { transform, OpenAIProvider } from 'foon-sdk';
// Define your target schema
const customerSchema = {
type: 'object',
properties: {
name: {
type: 'object',
properties: {
given: { type: 'string' },
family: { type: 'string' }
},
required: ['given', 'family']
},
email: { type: 'string', format: 'email' }
},
required: ['name', 'email']
};
// Transform messy webhook data
const result = await transform(
webhookPayload, // { fullName: 'Jane Smith', email_addr: 'jane@...' }
{
schema: customerSchema,
provider: new OpenAIProvider({
apiKey: process.env.OPENAI_API_KEY,
model: 'gpt-5-nano'
}),
confidenceThreshold: 0.85
}
);
if (result.ok) {
console.log(result.output);
// { name: { given: 'Jane', family: 'Smith' }, email: 'jane@...' }
} else {
console.error(result.error);
console.log(result.trace);
}Why FOON?
Built for production. Designed for developers who don't trust black boxes.
Schema Validation Mandatory
Every output is validated. Invalid data throws an error, never slips through.
Provider Agnostic
Works with OpenAI, Gemini, Anthropic, Ollama, or any OpenAI-compatible API.
Intelligent Caching
Mapping plans are cached. Same schema shape? Skip the AI call entirely.
Full Observability
Trace every transformation step. Debug issues with complete visibility.
Security Hooks
Redact sensitive fields, set limits, and add custom validation logic.
TypeScript Native
Full type inference from your schemas. Type-safe from input to output.
FOON Cloud
The open-source SDK is just the beginning. A managed platform is on the way.
Hosted Transforms
Run transformations in our cloud. No AI keys needed.
Shared Mapping Catalog
Browse and share mapping plans across your organization.
Team Analytics
Monitor transformation metrics, errors, and usage patterns.
Visual Editor
Build and debug mapping plans with a visual interface.
OSS stays OSS. The SDK will always be free and open source.
The cloud platform is optional for teams who want managed infrastructure.