Quickstart
Add an app in the console, add the SyncPilled Swift package to your iOS app, and see a record reach a second device.
1. Add your app
Sign in to the console and choose Add app.
Name it, and pick the sign-in provider your app already uses. For Firebase
Authentication you only need the project id; see Sign-in for the
others. The console gives the app an id such as my-notes-k2x9qa.
Add a development app and a production app if you keep the two apart: each has its own people and data.
2. Add the Swift package
Clone the SyncPilled repository. In Xcode, choose File → Add Package
Dependencies → Add Local, pick its syncpilled-swift folder, and add the
SyncPilled product to your app target. It needs iOS 18 or macOS 15, and has no
dependencies.
3. Connect it
import SyncPilled
let client = SyncPilledClient(
baseURL: URL(string: "https://api.syncpilled.com")!,
appId: "my-notes-k2x9qa",
issuerToken: { try await Auth.auth().currentUser!.getIDToken() }
)
let engine = SyncEngine(client: client, source: MyStore(), stateDirectory: .applicationSupportDirectory)MyStore is your side of the deal: it hands SyncPilled every synced record as
JSON, and writes in what arrives from the server. The Swift package
shows one for SwiftData.
4. Sync
Call try await engine.sync() at launch, when the app returns to the
foreground, and after saving. Sign in on a second device with the same account:
the first sync there downloads everything.
The console's People tab now lists the account, with how many records it holds.