mapkit object by providing an authorization callback and language.
- MapKit JS 5.0+Beta
MapKit JS initialization options.
Once you have completed your one-time Setting Up MapKit JS on the Apple Developer Website, you are ready to initialize MapKit JS.
If you are using a server to deliver new tokens to MapKit JS, make an asynchronous request to your server here and call the
done() function with the result.
Otherwise, you can simply pass a pre-generated token string.
init call can be made before the content of your page has fully loaded (e.g., before the window's “load” event has fired).
Signing your Authorization Token with JWT
Visit http://jwt.io for a list of recommended modules for most development languages. You will need the following details when configuring JWT to properly generate a signed authorization token:
All of the properties below are required for MapKit JS to successfully load
Time issues in seconds since unix epoch
Expiry time in seconds since unix epoch
Your Apple Developer Team ID
A domain restriction which should match the Origin header passed by a browser. (recommended)
Your Key ID
The code for signing a JWT token can be run server-side, and exposed as a web-service to your front-end. It can also be run on a development machine to generate a long-lived token to be checked directly into source-code. Libraries for signing JWT tokens can be found at jwt.io for most programming languages.