<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ThreadNetwork",
  "identifier" : "/documentation/ThreadNetwork/THClient",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "ThreadNetwork"
    ],
    "preciseIdentifier" : "c:objc(cs)THClient"
  },
  "title" : "THClient"
}
-->

# THClient

A class that supports safely sharing Thread credentials between multiple clients.

```
class THClient
```

## Overview

Request credentials for either a specific Thread network or for the *preferred network*
using [`THClient`](/documentation/ThreadNetwork/THClient). The preferred network is the default Thread network
chosen by the framework for a home.

The ThreadNetwork framework maintains a database of network credentials. The class
allows clients to store, list, and delete credentials for a given network from the
database.

Some methods in [`THClient`](/documentation/ThreadNetwork/THClient) use the *team ID*, a string that you store
in your application’s `Info.plist`. The ThreadNetwork framework uses the team ID
to preserve the privacy of the Thread network credentials across different clients.
For example, credentials stored by one client can’t be deleted or modified by another
client.

> Important: Thread credentials give you the ability to add any device into the Thread
> network. Use this information responsibly.

## Topics

### Creating the Client

[`-  init`](/documentation/ThreadNetwork/THClient/init())

Creates the client object.

### Retrieving Credentials

[`-  isPreferredNetworkAvailableWithCompletion:`](/documentation/ThreadNetwork/THClient/isPreferredNetworkAvailable(completion:))

Indicates whether a preferred network is available.

[`-  checkPreferredNetworkForActiveOperationalDataset:completion:`](/documentation/ThreadNetwork/THClient/checkPreferredNetwork(forActiveOperationalDataset:completion:))

Determines if the essential operating parameters match the preferred network’s parameters.

[`-  retrieveCredentialsForBorderAgent:completion:`](/documentation/ThreadNetwork/THClient/retrieveCredentials(forBorderAgent:completion:))

Requests Thread credentials for a Border Agent.

[`-  retrieveCredentialsForExtendedPANID:completion:`](/documentation/ThreadNetwork/THClient/retrieveCredentials(forExtendedPANID:completion:))

Requests Thread credentials for an extended Personal Area Network (PAN) ID.

[`-  retrieveAllCredentials:`](/documentation/ThreadNetwork/THClient/retrieveAllCredentials(_:))

Requests all Thread credentials from the framework.

[`-  retrievePreferredCredentials:`](/documentation/ThreadNetwork/THClient/retrievePreferredCredentials(_:))

Requests Thread credentials for the preferred network.

[`-  retrieveAllActiveCredentials:`](/documentation/ThreadNetwork/THClient/retrieveAllActiveCredentials(_:))

Returns a set of the active credentials.

### Storing and Deleting Credentials

[`-  deleteCredentialsForBorderAgent:completion:`](/documentation/ThreadNetwork/THClient/deleteCredentials(forBorderAgent:completion:))

Deletes Thread network credentials from the framework database for a Border Agent.

[`-  storeCredentialsForBorderAgent:activeOperationalDataSet:completion:`](/documentation/ThreadNetwork/THClient/storeCredentials(forBorderAgent:activeOperationalDataSet:completion:))

Stores Thread network credentials into the framework database that a Border Agent
provides.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)