---
title: "setCredentialWith(_:completionHandler:)"
framework: matter
role: symbol
role_heading: Instance Method
path: "matter/mtrbaseclusterdoorlock/setcredentialwith(_:completionhandler:)"
---

# setCredentialWith(_:completionHandler:)

## Declaration

```swift
func setCredentialWith(_ params: MTRDoorLockClusterSetCredentialParams, completionHandler: @escaping @Sendable (MTRDoorLockClusterSetCredentialResponseParams?, (any Error)?) -> Void)
```

```swift
func setCredentialWith(_ params: MTRDoorLockClusterSetCredentialParams) async throws -> MTRDoorLockClusterSetCredentialResponseParams
```
