---
title: "init(database:stateSerialization:delegate:)"
framework: cloudkit
role: symbol
role_heading: Initializer
path: "cloudkit/cksyncengine-5sie5/configuration/init(database:stateserialization:delegate:)"
---

# init(database:stateSerialization:delegate:)

Creates a configuration for the specified database and serialized state.

## Declaration

```swift
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 doc://com.apple.cloudkit/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.
