• Platform
  • Solutions
  • Developers
  • Showcase
  • Pricing
  • Company
Get Started
  • Platform

    • Overview
    • Conductor
    • Architecture
    • Security
    • Status

    Capabilities

    • All 276
    • AI & ML
    • Storage
    • Auth & Identity
    • Billing
    • Search
    • Compute
    • Media

    SDK

    • SDK Overview
    • Face Modules
    • Quickstart
    • Playground
    • CLI
  • By Role

    • For Startups
    • For Enterprise
    • For Agencies
    • For Developers
    • For CTOs

    By Industry

    • Fintech
    • E-Commerce
    • Healthcare
    • Media
    • SaaS
    • Education

    By Use Case

    • AI Applications
    • Internal Tools
    • Marketplaces
    • Automation
  • Documentation

    • Getting Started
    • API Reference
    • Authentication
    • Webhooks
    • Templates
    • Sandbox

    Integrations

    • All Integrations
    • Stripe
    • OpenAI
    • AWS
    • GitHub
    • Build Your Own

    Resources

    • Technical Guides
    • Architecture Patterns
    • Project Templates
    • Glossary
    • Platform Changelog
    • SDK Changelog
  • Featured Demos

    • Showcase Gallery
    • SaaS Dashboard
    • AI Chat
    • E-Commerce Store
    • Admin Panel
    • Marketplace

    Case Studies

    • All Case Studies
    • Catalist — Fintech
    • Zumar — E-Commerce
    • Nova — AI SaaS
    • Meridian — Media
    • Atlas — Operations

    Enterprise

    • Enterprise Overview
    • Security
    • Compliance
    • SLA & Uptime
    • Deployment Options
    • Startup Program
  • Plans

    • Overview
    • Compare Plans
    • Pricing Calculator
    • Enterprise Pricing

    Compare

    • EEv3 vs Agencies
    • EEv3 vs No-Code
    • EEv3 vs Freelancers
    • EEv3 vs In-House
    • EEv3 vs Firebase

    Services

    • All Services
    • Custom Development
    • Platform Hosting
    • Consulting
    • AI Integration
  • About

    • About VertexStudio
    • Team
    • Culture
    • The Group
    • Partners
    • Testimonials

    Careers

    • Open Roles
    • Engineering

    More

    • Contact
    • Newsroom
    • Brand Assets
    • Trust Center
    • Legal
  • Get Started
← SDK

TypeScript-First DX

Types all the way down.

The SDK isn't typed as an afterthought — it's built TypeScript-first. Every face, method, parameter, and response is fully typed with generics, branded types, and discriminated unions.

Why it matters

Your editor becomes your documentation.

Autocomplete

Every face, method, parameter, and response field appears in your editor. No docs needed — your IDE is the documentation.

Compile-time safety

Catch typos, wrong parameter types, and missing fields before you run a single line. Refactor with confidence.

Refactoring confidence

Rename a face method and TypeScript finds every call site. Change a response shape and the compiler shows every affected handler.

Generic Responses

Pass your schema, get typed data.

Generic type parameters flow through every face method. Pass your interface to ee.ai.generate<T>() and the response is typed to your schema — no runtime assertions needed.

generics.ts
// Generic response types — pass your schema, get typed data
interface RevenueReport {
  quarter: string
  revenue: number
  growth: number
  highlights: string[]
}

const report = await ee.ai.generate<RevenueReport>({
  model: 'claude-sonnet-4-20250514',
  prompt: 'Analyse Q3 revenue data',
  context: await ee.storage.get('data/q3.csv'),
  responseFormat: 'json',
})

// report.data is fully typed:
report.data.quarter    // string
report.data.revenue    // number
report.data.growth     // number
report.data.highlights // string[]

Discriminated Unions

Events narrowed by type.

Webhook events and async responses use discriminated unions. Switch on the type field and TypeScript narrows the data type automatically — no casting, no guards.

events.ts
// Discriminated unions for events
type WebhookEvent =
  | { type: 'user.created'; data: { userId: UserId; email: string } }
  | { type: 'user.deleted'; data: { userId: UserId; reason: string } }
  | { type: 'invoice.paid'; data: { invoiceId: InvoiceId; amount: number } }
  | { type: 'invoice.failed'; data: { invoiceId: InvoiceId; error: string } }

// TypeScript narrows the type automatically
function handleEvent(event: WebhookEvent) {
  switch (event.type) {
    case 'user.created':
      // event.data is { userId: UserId; email: string }
      console.log(event.data.email)
      break
    case 'invoice.paid':
      // event.data is { invoiceId: InvoiceId; amount: number }
      console.log(event.data.amount)
      break
  }
}

Branded Types

No more mixed-up IDs.

Every ID in the SDK is a branded type. A UserId is not assignable to an EntityId — the compiler catches the mistake before it reaches production.

branded-ids.ts
// Branded types for IDs — no mixing up user IDs and invoice IDs
type UserId = string & { readonly __brand: 'UserId' }
type EntityId = string & { readonly __brand: 'EntityId' }
type InvoiceId = string & { readonly __brand: 'InvoiceId' }

// The SDK returns branded types:
const user = await ee.auth.getUser({ id: userId })
user.id          // UserId (not just string)
user.entityId    // EntityId (not just string)

// This is a compile error — you can't pass an EntityId as a UserId:
// await ee.auth.getUser({ id: user.entityId })
//                          ^^^ Type 'EntityId' is not assignable to 'UserId'

Typed Errors

Exhaustive error handling.

Every error code is a typed literal. The switch statement covers every possible error — TypeScript tells you if you miss one. Each error code carries its own typed details object.

error-handling.ts
// Typed error codes with exhaustive switch
import { EEError, isEEError } from '@evileye/sdk'

try {
  await ee.billing.charge({ amount: 100, currency: 'usd' })
} catch (err) {
  if (isEEError(err)) {
    switch (err.code) {
      case 'INSUFFICIENT_FUNDS':
        // err.details is { balance: number; required: number }
        notifyUser(`Need ${err.details.required - err.details.balance} more`)
        break
      case 'CARD_DECLINED':
        // err.details is { reason: string; retryable: boolean }
        if (err.details.retryable) retry()
        break
      case 'RATE_LIMITED':
        // err.details is { retryAfter: number }
        await sleep(err.details.retryAfter)
        retry()
        break
      // TypeScript ensures you handle every case
    }
  }
}

Client Config

Every option documented in your editor.

types.ts
// Full client options interface — every option typed
interface EEClientOptions {
  /** API token (root or scoped) */
  token: string
  /** Entity identifier */
  entity: string
  /** Base URL override (default: https://api.evileye.dev) */
  baseUrl?: string
  /** Request timeout in ms (default: 30_000) */
  timeout?: number
  /** Retry configuration */
  retry?: {
    maxRetries?: number      // default: 3
    backoffMs?: number       // default: 1000
    backoffMultiplier?: number // default: 2
    retryableErrors?: ErrorCode[]
  }
  /** Custom fetch implementation */
  fetch?: typeof globalThis.fetch
  /** Logger instance */
  logger?: EELogger
  /** Enable debug mode */
  debug?: boolean
}

Experience the types yourself.

Install the SDK and let your editor show you what's possible.

Quickstart GuideTry the Playground
VertexStudio

The platform behind every company. 276 capabilities through one API.

Platform

  • Overview
  • Conductor
  • Capabilities
  • Architecture
  • Security
  • Status
  • Changelog

SDK & Docs

  • SDK
  • Face Modules
  • Quickstart
  • API Reference
  • Documentation
  • Integrations

Solutions

  • For Startups
  • For Enterprise
  • For Agencies
  • For Developers
  • Showcase
  • Case Studies

Services

  • Custom Development
  • Platform Hosting
  • API Access
  • Consulting
  • AI Integration

Company

  • About
  • Team
  • Careers
  • Partners
  • Newsroom
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • DPA
  • Acceptable Use
  • Trust Center
© 2026 VertexStudio. All rights reserved.
Privacy·Terms·Trust Center
Built with EEv3