Adding Oracle Backend with Supabase APIs to Your Apps
Register a web app in the Console, copy its configuration, and connect it using the relational JavaScript SDK.
Before You Begin
Before you add Oracle Backend with Supabase APIs to an app, make sure that:
-
Oracle Backend with Supabase APIs and DDS are enabled for the ORDS pool you will use, as described in Installing and Configuring Oracle Backend with Supabase APIs.
-
A schema has been enabled for Oracle Backend with Supabase APIs.
-
You can sign in to the Oracle Backend with Supabase APIs Console.
See Also:
For background and environment setup instructions, see:
Introduction
Oracle Backend with Supabase APIs services are shared by the project, not by individual apps. When you register an app in a project, the Console generates app-specific configuration that identifies the:
-
ORDS host the app connects to
-
Schema and project the app belongs to
-
App type and app identifier
-
Enabled authentication and storage settings for that project
The SDK uses this configuration to send your app’s requests to the selected backend in Oracle Backend with Supabase APIs.
If you later change the project’s enabled services, request the app configuration again from the Console so the app reflects the updated project state.
Add Oracle Backend with Supabase APIs to a Web App
This section shows how to register a web app, install the JavaScript SDK, paste in the generated configuration, and initialize Oracle Backend with Supabase APIs.
Prerequisites
Before you begin, ensure that:
-
You have a JavaScript project, or you are ready to create one before adding Oracle Backend with Supabase APIs.
-
Your project uses a JavaScript module workflow or framework tooling if you plan to use the modular SDK.
For new web apps, Oracle recommends the modular JavaScript SDK.
Register Your Web App
-
Open the Oracle Backend with Supabase APIs Console. Open a relational project, or create one by following Creating a Project.
Configure the authentication or object storage services your app needs before copying its SDK configuration. If you add or change services later, copy the updated configuration again.
-
On the project’s Overview page, select Web.
Figure 4-1 Register a Web App from the Console

-
For App Nickname, enter a name such as
TodoApp, then select Register App.Figure 4-2 Name the Web App

-
At Install SDK, review the installation command, then select Next. Install the package as described in Install the JavaScript SDK.
-
At Configure SDK, select Copy config and save the generated configuration for your application. Select Done to close the registration dialog.
For web apps, Oracle Backend with Supabase APIs uses a JavaScript configuration object that you paste into your application code.
To copy the configuration again, open Project settings > Applications, select your web app, and select Copy config in SDK config.
Figure 4-3 Retrieve the Web App Configuration

Description of the illustration dds-app-copy-config.png
Install the JavaScript SDK
Install the relational JavaScript SDK package from npm:
npm install @fusabase/fusabase-relational
Initialize the JavaScript SDK
Import createClient and create a client with the ORDS host and your app configuration:
import { createClient } from "@fusabase/fusabase-relational";
const client = createClient("http://localhost:8080/ords/fusabase_user/", {
schema: "fusabase_user",
app_name: "TodoApp",
app_type: "WEB",
app_id: "APP_ID",
project_id: "PROJECT_ID",
objs_type: "base",
storage_bucket: "STORAGE_BUCKET",
auth_type: "base",
auth_id: "AUTH_ID",
backend_type: "RELATIONAL"
});
Replace the following values with those copied from the Console:
APP_ID: your registered web app’s identifier.PROJECT_ID: the identifier of the project that contains the app.STORAGE_BUCKET: the generated storage bucket value.AUTH_ID: the generated authentication identifier.
Replace the example host, schema, app name, and service settings if your generated configuration differs. Keep the trailing / in the ORDS host URL and retain the configuration’s backend_type: "RELATIONAL" value.
The required configuration keys are schema, app_type, app_id, project_id, objs_type, storage_bucket, auth_type, and auth_id. The SDK accepts app_name as an optional value; keep it when copying the generated configuration.
Verify Application Data Access
Initializing a client does not verify connectivity or DDS permissions. Follow Verify Application Data Access to create a table, add rows, and configure a data grant through the Console. Then use your initialized client to confirm that the application receives only the permitted row.
Troubleshooting
By default, database HTTP responses produce an envelope containing data, error, count, status, and statusText. Check error before using returned data. Input validation, transport, or response-parsing failures can throw, so also handle exceptions:
To use the following insert example, first create a todos table and a data grant that permits the insert.
try {
const { data, error, status } = await client
.from("todos")
.insert({ title: "Write documentation" });
if (error) {
console.error("Message:", error.message);
console.error("HTTP status:", error.status);
console.error("Code:", error.code);
console.error("Details:", error.details);
console.error("Hint:", error.hint);
} else {
console.log(data);
}
} catch (error) {
console.error("Request failed:", error);
}
Use throwOnError() when you want HTTP error responses to throw a RelationalDatabaseError. The error can provide message, status, code, details, and hint values.
Next Steps
After verifying application data access, continue with the service-specific tasks for your project:
See Also:
For project concepts and project lifecycle tasks, see: