> ## Documentation Index
> Fetch the complete documentation index at: https://docs.insforge.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript and JavaScript SDK for InsForge

> Install and initialize the official InsForge TypeScript SDK in Node, browsers, and edge runtimes to use auth, database, storage, and realtime.

The InsForge TypeScript SDK provides a type-safe client for interacting with InsForge services from JavaScript and TypeScript applications.

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @insforge/sdk@latest
  ```

  ```bash yarn theme={null}
  yarn add @insforge/sdk@latest
  ```

  ```bash pnpm theme={null}
  pnpm add @insforge/sdk@latest
  ```
</CodeGroup>

```javascript theme={null}
import { createClient } from '@insforge/sdk';

const insforge = createClient({
  baseUrl: 'https://your-app.insforge.app',
  anonKey: 'your-anon-key'  // Optional: for public/unauthenticated requests
});
```

Find the anon key with `npx @insforge/cli secrets get ANON_KEY`, or in the dashboard: click **Install** and open **API Keys**.

## Quick start

```typescript theme={null}
import { createClient } from '@insforge/sdk';

const insforge = createClient({
  baseUrl: 'https://your-app.insforge.app',
  anonKey: 'your-anon-key'  // Optional: for public/unauthenticated requests
});
```

## Features

* **Database** - Type-safe CRUD operations with PostgREST
* **Authentication** - Email/password and OAuth authentication
* **Storage** - File upload, download, and management
* **Functions** - Invoke serverless edge functions
* **AI** - Chat completions and image generation
* **Realtime** - WebSocket-based pub/sub messaging
* **Payments** - Provider-scoped Stripe and Razorpay payment helpers

## SDK reference

<CardGroup cols={2}>
  <Card title="Database" icon="database" href="/sdks/typescript/database">
    CRUD operations, filters, and queries
  </Card>

  <Card title="Authentication" icon="lock" href="/sdks/typescript/auth">
    Sign up, sign in, OAuth, and user management
  </Card>

  <Card title="Storage" icon="cloud-arrow-up" href="/sdks/typescript/storage">
    File upload, download, and management
  </Card>

  <Card title="Functions" icon="bolt" href="/sdks/typescript/functions">
    Invoke serverless edge functions
  </Card>

  <Card title="AI" icon="brain" href="/sdks/typescript/ai">
    Chat completions and image generation
  </Card>

  <Card title="Realtime" icon="signal-stream" href="/sdks/typescript/realtime">
    WebSocket pub/sub messaging
  </Card>

  <Card title="Payments" icon="credit-card" href="/sdks/typescript/payments">
    Provider-scoped Stripe and Razorpay payment helpers
  </Card>
</CardGroup>
