Skip to main content

Connecting Manta Tables

Manta Tables are the internal, high-performance data storage provided by MantaHQ. This is the default data source for the MantaHQ SDK, allowing you to build and iterate on your data schema without managing external infrastructure.

1. Generate an API Key

To authorize communication between the SDK and your project, you must create a dedicated API key.

  1. Log in to your MantaHQ Dashboard.
  2. In the sidebar navigation, click API Keys.
  3. Click New API Key.
  4. Enter a descriptive name for your key.
  5. Copy and store the generated key immediately.

2. Configure your Tables

Before interacting with data via the SDK, you must define your schema in the dashboard.

  1. Navigate to Data Tables in your dashboard.
  2. Create a new table (e.g., users or products).
  3. Define your columns and data types using the visual interface.
  4. Note the Table Name; you will use this identifier in your SDK requests.

3. Initialize the Client

Initialize the SDK by providing the API Key generated in Step 1. For a complete walkthrough on environment setup, see the Quickstart guide.

TypeScript
import { MantaClient } from "mantahq-sdk";

const manta = new MantaClient({
apiKey: "manta_sk_live_xxxx", // Replace with your actual API key
});

When targeting Manta's internal tables, the request object is straightforward. Unlike external databases, you do not need to provide a db parameter, as the SDK defaults to your Manta Studio workspace.

TypeScript
// Targeting internal Manta Tables (default behavior)
await manta.fetchAllRecords({
table: "users",
where: { status: "active" },
});

Understanding the snippet

  • Default Routing: Because the db parameter is omitted, MantaHQ automatically executes the query against your internal data tables.
  • Table mapping: The table value must match the name of the table exactly as it appears in Manta Studio.
  • Managed Infrastructure: No connection strings or host configurations are required; Manta handles the scaling and availability of these tables automatically.

Key differences at a glance

FeatureManta TablesExternal Postgres
Storage LocationHosted by MantaYour Infrastructure
SDK Syntaxtable: "name"db: "name", table: "name"
Setup MethodVisual BuilderConnection String / Manual
Best ForNew projects & rapid prototypingExisting production data