Tutorial Zero to Hero Javascript

Mastering RepoDB: The Ultimate Getting Started Guide

Suman Malik
January 25, 2026

Introduction

Welcome to the ultimate guide for RepoDB. In this tutorial, we won't just show you how to connect; we'll show you how to build a production-grade integration. The best way to interact with RepoDB is through our official Node.js client SDK, which handles authentication, retries, and error parsing for you.

Step 1: Installation

Install the client using your preferred package manager:

npm install @suman-malik-repo/repodb-client
# or
yarn add @suman-malik-repo/repodb-client

Step 2: Obtaning Credentials

Security is paramount. You need an API token to talk to your database.

  1. Log in to your RepoDB Cloud Dashboard.
  2. Go to Settings > API Tokens.
  3. Click Generate New Token. Select "Read/Write" permissions if you intend to modify data.
  4. Copy this token immediately. For security reasons, we never show it again.

Step 3: Best Practices for Connection

Never hardcode your secrets. Use environment variables.

// config.js
import dotenv from 'dotenv';
dotenv.config();

export const dbConfig = {
    host: process.env.REPODB_HOST || 'https://repodb.ogensync.com',
    token: process.env.REPODB_TOKEN
};

Now, initialize the client. The RepoDB client is lightweight and stateless, so you don't need to worry about managing heavy connection pools like you do with Postgres.

import Repodb from '@suman-malik-repo/repodb-client';
import { dbConfig } from './config.js';

const db = new Repodb(dbConfig);

// Test the connection
try {
    const health = await db.execute('SELECT 1 as val');
    console.log('Database connected!', health.rows[0]);
} catch (err) {
    console.error('Connection failed:', err.message);
}

Note: If you are using our Managed Cloud, the host is always https://repodb.ogensync.com. We route you to your specific bucket automatically based on your token.

Ready to try RepoDB?

Get started with your own database in seconds.


Read Next

How to use MySQL Compatibility in RepoDB

A step-by-step guide on how to leverage the new MySQL dialect support in RepoDB....

Deep Dive: Our MySQL Compatibility Layer

A technical look at how we implemented MySQL support on top of a SQLite core, an...

Switching from SQLite to MySQL: Why and How

Already using RepoDB with SQLite? Here is why you might want to switch to the My...