Documentation
Everything you need to integrate GhostStrings into your tech stack.
GhostStrings is an Over-the-Air (OTA) content management system. It allows you to update any text, translation, or label in your application instantly, without re-publishing to the App Store or triggering a CI/CD build.
How it Works
GhostStrings operates on a "Fetch and Cache" model. Your app requests the latest strings on launch, and the SDK handles local persistence to ensure zero latency for the user.
- Integrate the 1KB SDK into your project.
- Sync your existing strings to the GhostStrings dashboard.
- Update content in real-time via the GhostStrings Editor.
Android SDK
Our Android SDK is a "Zero Code Change" solution. It intercepts standard Android resource calls and routes them through the GhostStrings OTA cache.
implementation("com.github.shahwaiz90:ghoststrings-android:1.4.0")
2. Global Initialization
Initialize in your Application class to enable the SDK globally.
GhostStrings.init(this, GhostStringsConfig(
projectId = "YOUR_ID",
enableAnimations = true // Enabled by default
))
3. Ghostly Animations
GhostStrings isn't just about text; it's about experience. On Android, the SDK leverages Compose's AnimatedContent to provide smooth cross-fade and slide transitions whenever a string is updated OTA.
4. Enable Interception
For Compose: Wrap your root content to enable stringResource() interception.
GhostStringsProvider {
MyAppContent() // stringResource(R.string.title) works automatically!
}
For Legacy Views: Override attachBaseContext in your Base Activity. This enables automatic interception for context.getString().
override fun attachBaseContext(newBase: Context) {
super.attachBaseContext(GhostStrings.wrapContext(newBase))
}
iOS SDK (Swift)
Integrate via Swift Package Manager (SPM). Add the package URL:
https://github.com/shahwaiz90/ghoststrings-ios
1. Initialization
Initialize in your App or AppDelegate. GhostStrings uses Method Swizzling to automatically intercept NSLocalizedString calls.
GhostStrings.shared.initSDK(config: GhostStringsConfig(
projectId: "YOUR_PROJECT_ID",
enableAnimations: true // Enabled by default
))
2. Ghostly Animations
On iOS, every OTA update is automatically wrapped in a withAnimation(.spring()) block. This ensures that when strings change, the UI slides and fades gracefully into the new state.
3. Zero-Change Usage
Simply use standard SwiftUI or UIKit localization APIs. The SDK intercepts them and provides OTA updates automatically.
Text("hero_title") // Swizzled! OTA values apply automatically.
4. Shorthand Extension (.gs)
For cleaner code, use our built-in String extension:
VStack {
Text("hero_title".gs)
.font(.largeTitle)
Text("welcome_msg".gs)
}
API Reference
If you prefer to build your own integration, you can use our REST API directly.
Endpoint: GET /api/project/:projectId
This returns a JSON object containing all production strings.
{
"welcome_msg": "Welcome back!",
"login_btn": "Sign In",
"login_btn:es": "Iniciar Sesión"
}