A C++ library for integrating Supabase into mobile applications (Android and iOS).
- Complete Supabase REST API integration
- Support for Android (
.solibraries) and iOS (.xcframework) - Optional OpenSSL support for HTTPS
- C and C++ interfaces
- Query builder with fluent API
- Support for authentication, database operations, storage, and RPC
For Android:
- Android NDK (set
ANDROID_NDKenvironment variable or install via Android Studio)
For iOS:
- macOS with Xcode installed
Note: OpenSSL is built automatically by the build script for HTTPS support.
The project uses a unified build script that builds for both platforms with OpenSSL by default:
# Build for both Android and iOS with OpenSSL (default)
./build.shThe script will:
- Build OpenSSL for Android and iOS
- Build Android .so libraries (arm64-v8a, x86_64)
- Build iOS .xcframework (device + simulator)
- Automatically skip iOS build if not running on macOS
-
Android:
.solibraries will be generated inlib/directorylib/libsupabase_arm64-v8a.solib/libsupabase_x86_64.so
-
iOS:
.xcframeworkwill be generated inios/directoryios/supabase.xcframework/
#include "supabase.h"
// Initialize client
Supabase::Client client;
client.begin("https://your-project.supabase.co", "your-anon-key");
// Insert data
std::string json = R"({"name": "John", "age": 30})";
int status = client.insert("users", json);
// Query data
std::string result = client.from("users")
.select("*")
.eq("age", "30")
.execute();
// RPC call
std::string rpc_result = client.rpc("my_function", R"({"param": "value"})");#include "supabase.h"
// Initialize
supabase_client_t client;
supabase_init(&client, "https://your-project.supabase.co", "your-anon-key");
// Insert
supabase_insert(&client, "users", "{\"name\": \"John\"}", 0);
// Select
char* result = supabase_select(&client, "users", "*", "age=30");
if (result) {
printf("Result: %s\n", result);
supabase_free_string(result);
}
// Cleanup
supabase_cleanup(&client);.
├── build.sh # Unified build script for Android and iOS
├── build_openssl_android.sh # OpenSSL build script for Android
├── build_openssl_ios.sh # OpenSSL build script for iOS
├── CMakeLists.txt # CMake configuration
├── Makefile # Alternative build system
├── src/
│ └── supabase.cpp # Supabase implementation
├── include/
│ └── supabase.h # Public API header
└── third_party/
├── httplib/ # HTTP client library
└── nlohmann/ # JSON library
See LICENSE file for details.