On this page you install the SDK, connect your app to the project and read the first rows of a table. It takes about five minutes.
Before you start
Section titled “Before you start”-
Create a project
In the console, go to Projects › Create project. Write down the project ID.
-
Register the platform
In Overview › Platforms, add your app’s domain (for example, localhost). Requests from other origins are rejected.
-
Create a table
In Databases, create the loja-principal database and the produtos table with a nome column.
Install the SDK
Section titled “Install the SDK”For browser apps, use @owbase/web. On the server, use @owbase/node with an API key.
Read a table
Section titled “Read a table”main.tsmain.tsterminal
import { Client, TablesDB, Query } from "@owbase/web";
const client = new Client() .setEndpoint("https://cloud.owbase.dev/v1") .setProject("loja-aurora");
const db = new TablesDB(client);
const { rows, total } = await db.listRows({ databaseId: "loja-principal", tableId: "produtos", queries: [Query.limit(10)]});
console.log(total, rows[0]);import { Client, TablesDB, Query } from "@owbase/node";
const client = new Client() .setEndpoint("https://cloud.owbase.dev/v1") .setProject("loja-aurora") .setKey(process.env.OWBASE_API_KEY ?? ""); // key with the rows.read scope
const db = new TablesDB(client);const { rows } = await db.listRows({ databaseId: "loja-principal", tableId: "produtos" });curl "https://cloud.owbase.dev/v1/tablesdb/loja-principal/tables/produtos/rows" \-H "X-Owbase-Project: loja-aurora" \-H "X-Owbase-Key: $OWBASE_API_KEY"Next steps
Section titled “Next steps”Add login with Accounts and sessions, set who can read each row in Permissions and upload files with Storage.
Was this page helpful?Thanks for your feedback.