Skip to main content
SDK Client Learn more

Type-Safe SDK Client

Build powerful frontend applications with our fully type-safe SDK client. From real-time data synchronization to advanced caching, get everything you need for modern web development.

import { createClient } from '@squelify/client-js'

const client = createClient({
  endpoint: 'https://api.example.com',
  auth: {
    apiKey: process.env.API_KEY
  }
})

// Type-safe API calls
const users = await client.users.findMany({
  where: { role: 'admin' },
  select: { id: true, name: true }
})

Type-Safe Client

First-class TypeScript support with automatic type inference from your backend schemas.

  • Auto-generated types
  • IntelliSense support
  • Runtime validation
  • Type-safe queries

// Example for Type-Safe Client
const users = await client.users.findMany({
  where: { active: true },
  select: { id: true, email: true }
}) // Fully typed response
              

Request Pipeline

Powerful middleware system for request/response transformation, caching, and error handling.

  • Request interceptors
  • Response transforms
  • Error middleware
  • Retry strategies

// Example for Request Pipeline
client.use(async (req, next) => {
  console.log('Before request')
  const res = await next(req)
  console.log('After request')
  return res
})
              

Data Caching

Built-in caching system with support for multiple storage backends and invalidation strategies.

  • Memory caching
  • Persistent storage
  • Cache invalidation
  • Prefetching

// Example for Data Caching
const users = await client.users.findMany({
  cache: {
    ttl: '5m',
    strategy: 'stale-while-revalidate'
  }
})
              

Real-time Support

WebSocket and Server-Sent Events support for real-time data synchronization.

  • WebSocket client
  • SSE support
  • Auto reconnection
  • Event handling

// Example for Real-time Support
const channel = client.subscribe('users')
channel.on('created', (user) => {
  console.log('New user:', user)
})
              

Quick Integration

Get started with our SDK in minutes

1

Install

Add the SDK to your project

2

Configure

Set up your client instance

3

Develop

Use type-safe API methods

4

Deploy

Ship with confidence

import { createClient } from '@squelify/client-js'

// Initialize the client
const client = createClient({
  endpoint: 'https://api.example.com',
  auth: {
    apiKey: process.env.API_KEY
  }
})

// Start making type-safe API calls
const users = await client.users.findMany({
  where: { role: 'admin' },
  select: { id: true, name: true }
})

// Enable real-time updates
const channel = client.subscribe('users')
channel.on('created', (user) => {
  console.log('New user:', user)
})

Build Your Next-Gen Content Platform

Join forward-thinking teams using Squelify as their content infrastructure

100%
Type-safe
REST
API Support
Enterprise
Ready