<!--
{
  "availability" : [
    "MapKit JS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/MapKitInitializationOptions/authorizationCallback",
  "metadataVersion" : "0.1.0",
  "role" : "Interface Property",
  "symbol" : {
    "kind" : "Interface Property",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "structp/mapkit.MapKitInitializationOptions/authorizationCallback"
  },
  "title" : "authorizationCallback"
}
-->

# authorizationCallback

A callback function that obtains a token.

```
authorizationCallback?: (this: null, done: (token: string) => void) => void;
```

## Parameters

`done`

A function that completes the MapKit JS token request, called after creating a new token.

## Discussion

MapKit JS asyncronously invokes the `authorizationCallback` function throughout a session to obtain new authorization tokens. In the callback, you create a token and pass it to the function that MapKit JS provides in the `done` parameter.

---

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)