Skip to content

FluxbaseClient

//fluxbase-kotlin/io.github.nimbleflux.fluxbase/FluxbaseClient

[jvm]
class FluxbaseClient

The top-level Fluxbase client — port of FluxbaseClient from sdk/src/client.ts.

Wires together the HTTP layer (http) and all sub-modules (auth, and later postgrest, realtime, storage, functions, jobs, etc.). Construct via the companion create factory (or the top-level createFluxbaseClient function), which resolves the URL and key from arguments or environment variables.

Usage:

val client = FluxbaseClient.create("https://flux.example.com", anonKey)
val (session, error) = client.auth.signInWithPassword("[email protected]", "pw")
Name Summary
Companion [jvm]
object Companion
Name Summary
ai [jvm]
val ai: FluxbaseAI
AI chatbots, conversations, usage.
auth [jvm]
val auth: FluxbaseAuth
The auth module.
branching [jvm]
val branching: FluxbaseBranching
Database branching (admin).
functions [jvm]
val functions: FluxbaseFunctions
Edge Functions module.
graphql [jvm]
val graphql: FluxbaseGraphQL
GraphQL module.
http [jvm]
val http: FluxbaseHttpClient
The shared HTTP client used by all modules.
jobs [jvm]
val jobs: FluxbaseJobs
Background Jobs module.
knowledgeBase [jvm]
val knowledgeBase: FluxbaseKnowledgeBase
Knowledge bases: documents, hybrid search, knowledge graph.
management [jvm]
val management: FluxbaseManagement
Client keys, webhooks, invitations.
rpc [jvm]
val rpc: FluxbaseRpc
RPC module — namespaced stored procedures.
secrets [jvm]
val secrets: FluxbaseSecrets
Encrypted Secrets module.
settings [jvm]
val settings: FluxbaseSettings
App/system settings + user secrets.
storage [jvm]
val storage: FluxbaseStorage
Storage module — file upload/download/list.
tenant [jvm]
val tenant: FluxbaseTenant
Multi-tenancy management (admin).
vector [jvm]
val vector: FluxbaseVector
Vector embedding + similarity search.
Name Summary
channel [jvm]
fun channel(name: String, transport: WebSocketTransport? = null): RealtimeChannel
Create a realtime channel for postgres_changes/broadcast/presence subscriptions. Port of channel() in client.ts:654-674.
from [jvm]
inline fun <reified T> FluxbaseClient.from(table: String, schema: String? = null): QueryBuilder<T>
Start a PostgREST query against table. Uses a reified type parameter so the kotlinx.serialization serializer is resolved at compile time.
setTenant [jvm]
fun setTenant(tenantId: String)
Set the active tenant for multi-tenancy. Sets the X-FB-Tenant header. Port of setTenant() in client.ts:567-574.