
UXRate runs AI-powered interviews inside your app — not in a browser, not in an email, not after the moment has passed. The SDK watches for trigger rules you configure in the dashboard (screen visits, events, time, user attributes) and automatically surfaces an interview overlay at the right moment. Without it, there's no way to reach users at the moment that matters.
Prerequisites
Step 1
Choose your preferred package manager.
In Xcode: File → Add Package Dependencies → paste:
https://github.com/SVUG-Tech/UXRateSDK.git
Select version 0.1.0 or later. Or add to your Package.swift:
dependencies: [
.package(
url: "https://github.com/SVUG-Tech/UXRateSDK.git",
from: "0.1.0"
)
]Step 2
Add one line to your app entry point.
import SwiftUI
import UXRateSDK
@main
struct MyApp: App {
init() {
UXRate.configure(apiKey: "YOUR_API_KEY")
}
var body: some Scene {
WindowGroup { ContentView() }
}
}YOUR_API_KEY with the key from your UXRate dashboard.useMockService: true to see the full interview overlay without a live API key or trigger rules: UXRate.configure(apiKey: "demo", useMockService: true)Step 3
Tell the SDK who the current user is. Call this after sign-in so the SDK can associate interviews with a participant.
UXRate.identify(
userId: "user-123",
properties: [
"plan": "pro",
"signup_date": "2025-01-15"
]
)userId is stored as the participant identifier on every interview this user completes — you'll see it in the dashboard responses. The properties dictionary is recorded alongside the session and will be used to power targeting rules once that feature launches.Step 4
Coming soonInterviews fire automatically when the SDK detects a matching rule you've configured in the dashboard.
page_visitShow when a user visits a screen matching a name pattern (powered by Step 6 tracking)eventShow after a specific event fires N times (powered by Step 5 tracking)time_basedShow after N days since app installuser_segmentShow to users with a specific identify() property valueStep 5
Call track() at key moments. Events feed into event-type trigger rules.
UXRate.track(event: "purchase_complete") UXRate.track(event: "onboarding_skipped") UXRate.track(event: "cart_abandoned")
track() is implemented and can be called today. Trigger rules that respond to these events will activate once trigger rule evaluation ships (Step 4).Step 6
Tag screens so the SDK can match page_visit trigger rules.
struct CheckoutView: View {
var body: some View {
VStack { /* your checkout UI */ }
.surveyScreen("Checkout")
}
}.surveyScreen("Name") to the content view inside each NavigationStack.Step 7
Use mock mode (Step 2 tip) or start a test interview from the dashboard Studies page.
🎉
Your SDK is connected. Create a study in the dashboard, then configure trigger rules to start reaching users automatically — or start a test interview manually from the Studies page.
Reference
Method names shown in Swift (iOS). Flutter and React Native use the same names — see the steps above for platform-specific syntax.
| Method | Description |
|---|---|
configure(apiKey:) | Initialize the SDK. Pass useMockService: true during development to test the overlay without a live API key |
identify(userId:properties:) | Set the current user's ID and attributes. userId is stored on every interview response; properties power user_segment trigger rules |
track(event:) | Track a behavioral event. Feeds event-type trigger rules — implemented today, fires automatically once trigger rule evaluation ships |
setScreen(_:) / .surveyScreen() | Set the current screen name. Feeds page_visit trigger rules — implemented today, fires automatically once trigger rule evaluation ships |