Client SDK
Call App Functions from the client SDK with auth headers injected automatically.
client.functions is a hand-written helper surface. It is consistent across SDKs, but unlike the generated REST core, it is not produced directly from OpenAPI.
Supported Client SDKs
- JavaScript (
@edgebase/web) - React Native (
@edgebase/react-native) - Dart / Flutter
- Swift
- Kotlin
- Java
- C#
- C++
Setup
- JavaScript
- Dart/Flutter
- Swift
- Kotlin
- Java
- C#
- C++
import { createClient } from '@edgebase/web';
const client = createClient('https://my-app.edgebase.dev');
import 'package:edgebase_flutter/edgebase.dart';
final client = ClientEdgeBase('https://my-app.edgebase.dev');
import EdgeBase
let client = EdgeBaseClient("https://my-app.edgebase.dev")
import dev.edgebase.sdk.client.ClientEdgeBase
val client = ClientEdgeBase("https://my-app.edgebase.dev")
import dev.edgebase.sdk.client.ClientEdgeBase;
import dev.edgebase.sdk.client.EdgeBase;
ClientEdgeBase client = EdgeBase.client("https://my-app.edgebase.dev");
using EdgeBase;
var client = new EdgeBase("https://my-app.edgebase.dev");
#include <edgebase/edgebase.h>
client::EdgeBase client("https://my-app.edgebase.dev");
Basic Calls
- JavaScript
- Dart/Flutter
- Swift
- Kotlin
- Java
- C#
- C++
const result = await client.functions.post('send-email', {
to: 'user@example.com',
subject: 'Welcome!',
});
const users = await client.functions.get('users');
await client.functions.delete('users/abc123');
final result = await client.functions.post('send-email', {
'to': 'user@example.com',
'subject': 'Welcome!',
});
final users = await client.functions.get('users');
await client.functions.delete('users/abc123');
let result = try await client.functions.post("send-email", body: [
"to": "user@example.com",
"subject": "Welcome!",
])
let users = try await client.functions.get("users")
try await client.functions.delete("users/abc123")
val result = client.functions.post("send-email", mapOf(
"to" to "user@example.com",
"subject" to "Welcome!"
))
val users = client.functions.get("users")
client.functions.delete("users/abc123")
var result = client.functions().post("send-email", Map.of(
"to", "user@example.com",
"subject", "Welcome!"
));
var users = client.functions().get("users");
client.functions().delete("users/abc123");
var result = await client.Functions.PostAsync("send-email", new {
to = "user@example.com",
subject = "Welcome!"
});
var users = await client.Functions.GetAsync("users");
await client.Functions.DeleteAsync("users/abc123");
auto result = client.functions().post(
"send-email",
R"({"to":"user@example.com","subject":"Welcome!"})"
);
auto users = client.functions().get("users");
client.functions().del("users/abc123");
Generic Call
- JavaScript
- Dart/Flutter
- Swift
- Kotlin
- Java
- C#
- C++
const result = await client.functions.call('my-function', {
method: 'PUT',
body: { name: 'Updated' },
});
final result = await client.functions.call(
'my-function',
options: const FunctionCallOptions(
method: 'PUT',
body: {'name': 'Updated'},
),
);
let result = try await client.functions.call(
"my-function",
options: FunctionCallOptions(
method: "PUT",
body: ["name": "Updated"]
)
)
val result = client.functions.call(
"my-function",
FunctionCallOptions(
method = "PUT",
body = mapOf("name" to "Updated")
)
)
var result = client.functions().call(
"my-function",
new FunctionsClient.FunctionCallOptions(
"PUT",
Map.of("name", "Updated"),
null
)
);
var result = await client.Functions.CallAsync("my-function", new FunctionCallOptions {
Method = "PUT",
Body = new { name = "Updated" }
});
auto result = client.functions().call(
"my-function",
"PUT",
R"({"name":"Updated"})"
);
Authentication
If the user is signed in, the SDK sends the auth token automatically.
await client.auth.signIn({ email: 'user@test.com', password: 'pass123' });
const profile = await client.functions.get('me/profile');
Server function:
export const GET = defineFunction(async ({ auth, admin }) => {
if (!auth) throw new FunctionError('unauthenticated', 'Login required');
return admin.db('shared').table('profiles').get(auth.id);
});
Notes
- React Native uses the same
functionsAPI shape as the web SDK. - C++ uses JSON strings for request bodies instead of language-level map serialization helpers.
- Function routes are always resolved under
/api/functions/*.