跳轉到主要內容
InsForge Kotlin SDK 為從 Android 應用程式和 Kotlin 多平台專案與 InsForge 服務互動提供了原生 Kotlin 用戶端。

安裝

  1. Add InsForge dependencies to your project
build.gradle.kts:
  1. Initialize InsForge SDK
  1. Enable Logging (Optional)
For debugging, you can configure the SDK log level:
Log LevelDescription
NONENo logging (default, recommended for production)
ERROROnly errors
WARNWarnings and errors
INFOInformational messages
DEBUGDebug info (request method, URL, response status)
VERBOSEFull details (headers, request/response bodies)
Use NONE or ERROR in production to avoid exposing sensitive data in logs.

Android Initialization

  1. Add Chrome Custom Tabs dependency to your build.gradle.kts:
  1. Initialize InsForge SDK (With Chrome Custom Tabs and Session Storage)
  1. Use Jetpack DataStore for Session Storage (Optional)

功能

  • 資料庫 - 使用 Kotlin 序列化實現類型安全的 CRUD 作業
  • 身份驗證 - 電子郵件/密碼和 OAuth 身份驗證
  • 儲存空間 - 檔案上傳、下載和管理
  • AI - 聊天完成和圖像生成
  • 即時 - 基於 WebSocket 的發佈/訂閱訊息傳遞
  • 協程 - 完整的 Kotlin 協程支援
  • Jetpack Compose - 可組合函式和狀態管理

平台支援

平台支援
Android5.0+ (API 21+)
JVMJava 11+
Kotlin 多平台(即將推出)iOS、macOS、JS(實驗性)

SDK 參考

資料庫

使用 Kotlin 資料類的 CRUD 作業

身份驗證

註冊、登入、OAuth 和使用者管理

儲存空間

檔案上傳、下載和管理

AI

聊天完成和圖像生成

即時

WebSocket 發佈/訂閱訊息傳遞