Skip to content

DatabiteDev/databite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Databite SDK

Databite SDK Hero

A comprehensive TypeScript SDK for building, managing, and executing connectors to third-party APIs. The Databite SDK provides a powerful, type-safe way to create integrations with external services, manage data synchronization, and build robust data pipelines.

πŸ—οΈ Architecture

The Databite SDK is built as a modular monorepo with the following packages:

databite/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ build/          # Core SDK for building connectors
β”‚   β”œβ”€β”€ connect/        # React components for UI integration
β”‚   β”œβ”€β”€ connectors/     # Pre-built connector library
β”‚   β”œβ”€β”€ engine/         # Data synchronization and execution engine
β”‚   β”œβ”€β”€ server/         # Express server with API endpoints
β”‚   β”œβ”€β”€ types/          # Shared TypeScript types
β”‚   β”œβ”€β”€ example-webapp/ # Example Next.js web application
β”‚   └── example-server/ # Example Express server

πŸ“¦ Packages

Core Packages

Integration Packages

πŸš€ Quick Start

Installation

# Install core packages
npm install @databite/build @databite/types

# Install additional packages as needed
npm install @databite/connectors @databite/engine @databite/connect @databite/server

Basic Usage

import { createConnector, createAction } from "@databite/build";
import { z } from "zod";

// Create a connector
const myConnector = createConnector()
  .withIdentity("my-service", "My Service")
  .withVersion("1.0.0")
  .withAuthor("Your Name")
  .withLogo("https://example.com/logo.png")
  .withDescription("Connector for My Service")
  .withActions({
    getData: createAction({
      label: "Get Data",
      description: "Fetch data from the service",
      inputSchema: z.object({ id: z.string() }),
      outputSchema: z.object({ data: z.any() }),
      handler: async (params, connection) => {
        // Your implementation
        return { data: { id: params.id } };
      },
    }),
  })
  .build();

🎯 Key Concepts

Three-Tier Hierarchy

  1. Connector - A template/blueprint that defines what properties and configurations are available
  2. Integration - An instance of a connector where specific values have been filled in for the properties and configs
  3. Connection - When someone actually uses an integration to connect to a service

Core Features

  • πŸ”§ Connector Builder: Fluent API for defining connectors with full TypeScript support
  • ⚑ Flow Engine: Execute complex authentication and data workflows with automatic type inference
  • πŸ”„ Sync Engine: Handle recurring data synchronization with cron/interval scheduling
  • πŸ“Š Context Manager: Manage execution contexts and state across flows
  • 🎨 React Components: Pre-built UI components for easy integration
  • πŸš€ Express Server: Ready-to-use Express server with RESTful API endpoints

πŸ“š Documentation

Package Documentation

πŸ› οΈ Development

Prerequisites

  • Node.js >= 16.0.0
  • TypeScript >= 4.5.0
  • npm or yarn

Setup

# Clone the repository
git clone https://github.com/DatabiteDev/databite.git
cd databite

# Install dependencies
pnpm install

# Build all packages
pnpm run build:all

# Run tests
pnpm test

Project Structure

databite/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ build/                    # Core SDK
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   └── connector-builder/ # Builder implementation
β”‚   β”‚   β”œβ”€β”€ examples/             # Usage examples
β”‚   β”‚   └── README.md
β”‚   β”œβ”€β”€ connect/                  # React components
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ components/       # UI components
β”‚   β”‚   β”‚   └── lib/             # Utility functions
β”‚   β”‚   └── README.md
β”‚   β”œβ”€β”€ connectors/               # Pre-built connectors
β”‚   β”‚   β”œβ”€β”€ src/connectors/       # Connector implementations
β”‚   β”‚   └── README.md
β”‚   β”œβ”€β”€ engine/                   # Data synchronization and execution engine
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ sync-engine/      # Sync engine implementation
β”‚   β”‚   β”‚   β”œβ”€β”€ action-executer/  # Action execution logic
β”‚   β”‚   β”‚   β”œβ”€β”€ rate-limiter/     # Rate limiting functionality
β”‚   β”‚   β”‚   β”œβ”€β”€ databite-engine/  # Main engine implementation
β”‚   β”‚   β”‚   └── flow-manager/     # Flow session management
β”‚   β”‚   └── README.md
β”‚   β”œβ”€β”€ server/                   # Express server
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ server.ts         # Main server implementation
β”‚   β”‚   β”‚   └── utils.ts          # Utility functions
β”‚   β”‚   └── README.md
β”‚   β”œβ”€β”€ types/                    # Shared types
β”‚   β”‚   β”œβ”€β”€ src/types/            # Type definitions
β”‚   β”‚   └── README.md
β”‚   β”œβ”€β”€ example-webapp/           # Example Next.js application
β”‚   β”‚   β”œβ”€β”€ app/                  # Next.js app directory
β”‚   β”‚   β”œβ”€β”€ components/           # Shared components
β”‚   β”‚   └── README.md
β”‚   └── example-server/           # Example Express server
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   └── index.ts          # Server setup example
β”‚       └── README.md

πŸš€ Release Workflow

Creating a Changeset

To document changes for a release:

# Create a changeset describing changes
pnpm changeset

Publishing a Release

When ready to release:

# When ready to release:
pnpm release

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

πŸ“‹ Code of Conduct

This project adheres to a Code of Conduct to ensure a welcoming and inclusive environment for all contributors and community members. We are committed to providing a harassment-free experience for everyone, regardless of background, identity, or experience level.

Please read our Code of Conduct to understand our community guidelines and expectations for participation.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

About

An open source Integration Platform

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published