---
title: "setMetadata(_:keyPath:value:)"
framework: USDKit
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: "usdkit/usdstage/object/metadatacollection/setmetadata(_:keypath:value:)-62b48"
---

# setMetadata(_:keyPath:value:)

Sets the value at keyPath within the dictionary-valued metadata for the given key.

## Declaration

```swift
func setMetadata<T>(_ key: USDToken, keyPath: USDToken, value: T) throws where T : USDStage.Object.MetadataValue
```
