Welcome to Nebutra Sailor Docs 🎉
ChangelogIntroductionLicensing
Help Center (External) ↗

JavaScript / TypeScript packages

There is no published @nebutra/sdk — the packages you import are the ones already in your scaffolded project.

There is no @nebutra/sdk

Nebutra-Sailor is not a hosted API with a client SDK — create-sailor gives you the whole backend as code in your own repo. There's nothing to install that isn't already there, and no API key to initialize a client with.

What you import instead are the @nebutra/* workspace packages the scaffold ships, directly, from your own app code:

PackageFor
@nebutra/authBetter Auth server instance, signServiceToken / verifyServiceToken for internal calls
better-auth/react (createAuthClient)Session state on the client — see the React Quickstart
@nebutra/permissions / @nebutra/permissions/reactCan, usePermission, requirePermission — RBAC/ABAC
@nebutra/tenantgetCurrentTenant, withRls — tenant context and row-level security
@nebutra/billingCheckout, entitlements (checkEntitlement, FEATURES), usage metering
@nebutra/dbgetSystemDb() / getTenantDb(tenantId) — the Prisma client
@nebutra/loggerStructured logging
import { getTenantDb } from "@nebutra/db";
import { getCurrentTenant } from "@nebutra/tenant";
import { checkEntitlement } from "@nebutra/billing";

const tenant = getCurrentTenant();
const db = getTenantDb(tenant.id);

Calling the gateway from outside the monorepo

If a separate service needs to call your project's backends/gateway REST API over HTTP, there is no client library for that either — call it directly and authenticate with the shared SERVICE_SECRET (see Node.js Quickstart) or forward the caller's Better Auth session. The gateway documents itself via OpenAPI at /docs and /openapi.json.

Related

Gateway API

The REST endpoints your project ships with.

Concepts: Architecture

Where the gateway fits and what runs where.

How is this guide?

Edit on GitHub

Last updated on

On this page

There is no @nebutra/sdk
Calling the gateway from outside the monorepo
Related