Start > Getting Started
Start > Getting StartedKroxt BaaS SDK v1.0.5

Getting Started

Kroxt BaaS is an all-in-one backend-as-a-service platform built on top of MongoDB and designed to equip modern web and mobile applications with secure user authentication, automatic document collection CRUD, bucket storage, transactional email dispatches, and VM-isolated serverless functions.

A

Option A: The One-Command Quickstart (Recommended)

The fastest way to get started with Kroxt BaaS is by running our official scaffolding tool. It prompts you for project credentials, framework preferences, and styling settings to configure a production-ready application in seconds.

terminal
1
npx create-kroxt-app

This command supports **Next.js**, **Vite + React**, and **React Native (Expo)** templates, including optional automatic Tailwind CSS setups and vanilla fallbacks.

B

Option B: Manual Installation

To add Kroxt BaaS to an existing project, install the client SDK package manually:

terminal
1
npm install @kroxt/baas-sdk

Initialize the Client

Import and instantiate the Kroxt client using your credentials.

lib/kroxt.ts
1
2
3
4
5
6
7
8
import { Kroxt } from "@kroxt/baas-sdk";

export const baas = new Kroxt({
  projectId: "YOUR_KROXT_PROJECT_ID",
  apiKey: "YOUR_KROXT_PUBLIC_API_KEY",
});

export default baas;

First Document Operation

Create a document in a collection (verify that you have created the collection in the dashboard first):

app/page.tsx
1
2
3
4
5
6
7
8
9
import { baas } from "@/lib/kroxt";

async function createTodo() {
  const todo = await baas.collection("todos").create({
    text: "Learn Kroxt BaaS",
    completed: false,
  });
  console.log("Success! Document ID:", todo._id);
}