<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "watchOS: 7.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NearbyInteraction",
  "identifier" : "/documentation/NearbyInteraction/NINearbyPeerConfiguration/init(peerToken:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Nearby Interaction"
    ],
    "preciseIdentifier" : "c:objc(cs)NINearbyPeerConfiguration(im)initWithPeerToken:"
  },
  "title" : "init(peerToken:)"
}
-->

# init(peerToken:)

Creates a configuration for interaction between devices, including iPhone and Apple Watch.

```
init(peerToken: NIDiscoveryToken)
```

## Parameters

`peerToken`

The value of another device’s discovery token. This value uniquely identifies the other peer in the interaction session.

## Discussion

To acquire a peer’s discovery token, two instantiations of the app exchange their respective [`discoveryToken`](/documentation/NearbyInteraction/NISession/discoveryToken) over the network using a method you choose. For a discussion that covers sharing discovery tokens using <doc://com.apple.documentation/documentation/MultipeerConnectivity>, see [Discovering peers with Multipeer Connectivity](/documentation/NearbyInteraction/discovering-peers-with-multipeer-connectivity).

---

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)