The iOS SDK for Formbricks
- In Xcode choose File → Add Packages…
- Enter
https://github.com/formbricks/ios.git. - Choose version rule (e.g. "Up to Next Major" starting at
2.3.1). - Add the FormbricksSDK library product to your app target.
- Import in your code:
import FormbricksSDK
New FormbricksSDK releases are distributed through Swift Package Manager only. CocoaPods Trunk is becoming read-only, with a test period on November 1–7, 2026 and a permanent switch on December 2, 2026. Previously published pod versions remain available; migrate to receive future SDK updates.
- Remove the
pod 'FormbricksSDK', ...entry from every target in yourPodfile. - Run
pod installto update the workspace and lockfile. Keep any other pods your app uses. - Follow the Swift Package Manager instructions above and add FormbricksSDK to each app target that uses it. Do not link both the pod and the Swift package in the same target.
- Keep
import FormbricksSDKand your existing SDK calls. Build and test your app after switching. If you also upgrade the SDK version, review its release notes.
import FormbricksSDK
// 1. Build your config (you can also inject userId + attributes here)
let config = FormbricksConfig.Builder(
appUrl: "https://your‑app.bricks.com",
workspaceId: "YOUR_WORKSPACE_ID"
)
.setLogLevel(.debug)
.build()
// Note: `environmentId` is still supported as a deprecated alias for
// `workspaceId` and will be removed in a future release.
// Existing integrations using `environmentId` continue to work:
//
// FormbricksConfig.Builder(
// appUrl: "https://your‑app.bricks.com",
// environmentId: "YOUR_ENV_ID" // deprecated, use workspaceId
// )
// 2. Initialize the SDK (once per launch)
Formbricks.setup(with: config)
// 3. Identify the user
Formbricks.setUserId("user‑123")
// 4. Track events
Formbricks.track("button_pressed")
// 5. Set or add user attributes
Formbricks.setAttribute("blue