Skip to content

Quickstart

WhiskrKit is distributed via Swift Package Manager. This guide gets you from zero to your first survey in a few steps.

In Xcode, go to File → Add Package Dependencies and enter the WhiskrKit repository URL. Set the dependency rule to Up to Next Major Version.

Call initialize as early as possible, your App entry point is the right place.

import SwiftUI
import WhiskrKit
@main
struct MyApp: App {
init() {
WhiskrKit.shared.initialize(
apiKey: "wk_live_your_api_key",
withMockedSurveys: false
)
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}

Your API key is available in the WhiskrKit dashboard under Settings → API Keys.

Add the .whiskrKitSurvey(identifier:) modifier to any view where you want a survey to potentially appear. WhiskrKit evaluates eligibility automatically based on the rules you configure in the dashboard.

struct HomeView: View {
var body: some View {
VStack {
Text("Welcome")
}
.whiskrKitSurvey(identifier: "your-survey-id")
}
}

That’s it. WhiskrKit handles the rest, eligibility checks, presentation timing, and response submission.