Skip to main content

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

import { createClient } from '@edgebase/web';

const client = createClient('https://my-app.edgebase.dev');

Basic Calls

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');

Generic Call

const result = await client.functions.call('my-function', {
method: 'PUT',
body: { 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 functions API 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/*.