The TypeScript SDK (Documentation Index
Fetch the complete documentation index at: https://docs.getomni.co/llms.txt
Use this file to discover all available pages before exploring further.
@getomnico/connector) provides everything you need to build custom connectors that integrate with Omni’s search and AI platform.
Installation
The SDK is not published to npm. Connectors live in the Omni monorepo and depend on the SDK as a local file path. To start a new TypeScript connector, fork or clone omni and create a directory underconnectors/:
package.json, reference the SDK with a file: link — copy from connectors/linear/package.json:
- Node.js >= 20.0.0
express- Web frameworkpino- Structured loggingzod- Schema validation
Quick Start
Core Concepts
Connector Class
TheConnector abstract class defines the interface for all connectors.
Required Properties:
| Property | Type | Description |
|---|---|---|
name | string | Unique connector identifier (e.g., "my-connector") |
version | string | Semantic version (e.g., "1.0.0") |
| Property | Type | Default | Description |
|---|---|---|---|
syncModes | string[] | ["full"] | Supported modes: "full", "incremental" |
actions | ActionDefinition[] | [] | Custom actions the connector supports |
SyncContext
TheSyncContext object is passed to your sync method and provides utilities for the sync operation.
Properties:
| Property | Type | Description |
|---|---|---|
syncRunId | string | Unique identifier for this sync run |
sourceId | string | Source identifier |
state | Record<string, unknown> | null | State from previous sync |
contentStorage | ContentStorage | Storage for document content |
documentsEmitted | number | Count of emitted documents |
documentsScanned | number | Count of scanned items |
ContentStorage
TheContentStorage class handles storing document content.
contentId is a ULID that references the stored content.
Document Model
TheDocument interface represents a searchable document.
| Field | Type | Required | Description |
|---|---|---|---|
external_id | string | Yes | Unique ID from the source system |
title | string | Yes | Document title for display |
content_id | string | Yes | Reference to stored content |
metadata | DocumentMetadata | No | Document metadata |
permissions | DocumentPermissions | No | Access control |
attributes | Record<string, unknown> | No | Custom searchable attributes |
Actions
Connectors can define custom actions that users can trigger from the Omni UI.RSS Connector Example
Here’s a complete example of an RSS feed connector:Error Handling
The SDK provides custom error classes:Development
Project Setup
TypeScript Configuration
The SDK uses strict TypeScript settings. Yourtsconfig.json should include:
API Reference
Exports
The SDK exports the following: Core Classes:Connector- Abstract base classSyncContext- Sync operation contextContentStorage- Content storage interfaceSdkClient- SDK client for connector-manager
Document,DocumentMetadata,DocumentPermissionsConnectorEvent,EventTypeActionDefinition,ActionParameterActionRequest,ActionResponseConnectorManifest,SyncModeSyncRequest,SyncResponseCancelRequest,CancelResponse
ConnectorError,SdkClientError,SyncCancelledError,ConfigurationError
Zod Schemas
All data models include Zod schemas for runtime validation:What’s Next
SDK Overview
Learn about SDK architecture
Python SDK
Build connectors with Python