---
title: "init(from:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/networkcompatibilitytoken/init(from:)"
---

# init(from:)

Creates a new instance from a decoder.

## Declaration

```swift
required init(from decoder: any Decoder) throws
```

## Parameters

- `decoder`: The decoder to read data from.

## Discussion

Discussion Throws an error if reading from decoder fails, or if the data is corrupted or otherwise invalid.

## See Also

### Serializing tokens

- [encode(to:)](realitykit/networkcompatibilitytoken/encode(to:).md)
