<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MusicKit",
  "identifier" : "/documentation/MusicKit/MusicDeveloperTokenProvider/developerToken(options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MusicKit"
    ],
    "preciseIdentifier" : "s:8MusicKit0A22DeveloperTokenProviderP09developerD07optionsSSAA0aD14RequestOptionsV_tYaKF"
  },
  "title" : "developerToken(options:)"
}
-->

# developerToken(options:)

Fetches and returns a developer token for Apple Music API.

```
func developerToken(options: MusicTokenRequestOptions) async throws -> String
```

## Discussion

If you opt to create a custom implementation of the
[`MusicDeveloperTokenProvider`](/documentation/MusicKit/MusicDeveloperTokenProvider) protocol, make sure to discard
any cached developer token if the `options` parameter contains
[`ignoreCache`](/documentation/MusicKit/MusicTokenRequestOptions/ignoreCache).

You can add the newly generated token to an in-memory or persistent
cache for faster access upon subsequent requests for this token.

---

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)