Skip to main content

Prerequisites

Before installing Databite SDK, ensure you have:
  • Node.js >= 16.0.0
  • TypeScript >= 4.5.0 (recommended)
  • npm, yarn, pnpm, or bun package manager

Core Installation

Install the main Databite packages:
npm install @databite/server @databite/connect

Additional Packages

Install additional packages based on your needs:

React Integration

@databite/connect requires React peer dependencies:
npm install react react-dom typescript

Pre-built Connectors

For ready-to-use connectors:
npm install @databite/connectors

Data Synchronization (optional)

npm install @databite/engine bullmq

Package Manager Options

npm

# Main packages
npm install @databite/server @databite/connect

# Optional packages
npm install @databite/build @databite/connectors @databite/engine @databite/types

yarn

# Main packages
yarn add @databite/server @databite/connect

# Optional packages
yarn add @databite/build @databite/connectors @databite/engine @databite/types

pnpm

# Main packages
pnpm add @databite/server @databite/connect

# Optional packages
pnpm add @databite/build @databite/connectors @databite/engine @databite/types

bun

# Main packages
bun add @databite/server @databite/connect

# Optional packages
bun add @databite/build @databite/connectors @databite/engine @databite/types

TypeScript Configuration

Ensure your tsconfig.json includes the necessary compiler options:
{
  "compilerOptions": {
    "target": "ES2020",
    "lib": ["ES2020", "DOM"],
    "module": "ESNext",
    "moduleResolution": "node",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "resolveJsonModule": true,
    "allowSyntheticDefaultImports": true
  }
}

Environment Setup

Node.js Environment

For server-side usage:
// No additional setup required
import { createConnector } from "@databite/build";

Browser Environment

For client-side usage with React:
import { ConnectModal } from "@databite/connect";

Next.js

For Next.js applications, add the modal where you need user authentication:
import { ConnectModal } from "@databite/connect";

Verification

Test your installation by creating a simple connector:
import { createConnector } from "@databite/build";
import { z } from "zod";

const testConnector = createConnector()
  .withIdentity("test", "Test Connector")
  .withVersion("1.0.0")
  .withAuthor("Test")
  .withDescription("Test connector")
  .withIntegrationConfig(z.object({}))
  .withConnectionConfig(z.object({}))
  .build();

console.log("Databite SDK installed successfully!");

Troubleshooting

Common Issues

Ensure you have TypeScript >= 4.5.0 installed and properly configured. Check your tsconfig.json for the correct compiler options.
Install the required peer dependencies for the packages you’re using. Each package’s documentation lists its peer dependencies.
Make sure your tsconfig.json has "moduleResolution": "node" and "esModuleInterop": true enabled.
If using @databite/connect, ensure you’re using React 16.8+ and have react and react-dom installed.

Getting Help

If you encounter issues:
  1. Check the Common Issues guide
  2. Review the Debugging guide
  3. Join our Discord community
  4. Open an issue on GitHub

Next Steps