<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKSyncEngine-5sie5/Configuration/init(database:stateSerialization:delegate:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "s:8CloudKit12CKSyncEngineC13ConfigurationV8database18stateSerialization8delegateAESo10CKDatabaseC_AC5StateC0H0VSgAA0cD8Delegate_ptcfc"
  },
  "title" : "init(database:stateSerialization:delegate:)"
}
-->

# init(database:stateSerialization:delegate:)

Creates a configuration for the specified database and serialized state.

```
init(database: CKDatabase, stateSerialization: CKSyncEngine.State.Serialization?, delegate: any CKSyncEngineDelegate)
```

## Parameters

`database`

The database to sync — either a person’s private database or their shared database.

`stateSerialization`

If this is the first initialization of the associated sync engine, specify `nil`; otherwise, specify the state from the most recent [`CKSyncEngine.Event.stateUpdate(_:)`](/documentation/CloudKit/CKSyncEngine-5sie5/Event/stateUpdate(_:)) event that your delegate handled.

`delegate`

The object that provides the records to sync and handles any related events.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)