Quickstart
WhiskrKit is distributed via Swift Package Manager. This guide gets you from zero to your first survey in a few steps.
1. Add the package
Section titled “1. Add the package”In Xcode, go to File → Add Package Dependencies and enter the WhiskrKit repository URL. Set the dependency rule to Up to Next Major Version.
2. Initialise the SDK
Section titled “2. Initialise the SDK”Call initialize as early as possible, your App entry point is the right place.
import SwiftUIimport WhiskrKit
@mainstruct 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.
3. Attach a survey
Section titled “3. Attach a survey”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.
Next steps
Section titled “Next steps”- Learn about automatic vs manual presentation
- Customise the look with theming
- Trigger surveys from a button or push notification using the manual API