Elixir client for Apple MapKit JS token generation.
MapKit JS uses an ES256 JWT that your web app passes to mapkit.init/1.
This library focuses on generating and caching that JWT.
The public surface is intentionally small:
MapkitJS.token()
MapkitJS.generate_token(origin: "https://example.com")
MapkitJS.authorization_callback_payload()Configuration
config :mapkit_js,
team_id: System.get_env("APPLE_TEAM_ID"),
key_id: System.get_env("MAPKIT_KEY_ID"),
private_key: System.get_env("MAPKIT_PRIVATE_KEY"),
origin: System.get_env("MAPKIT_ORIGIN")Every function also accepts per-call opts that override the application config.
Summary
Functions
Return the payload commonly passed into a browser-side authorizationCallback.
Generate a new MapKit JS JWT.
Return a MapKit JS JWT using the configured token cache behavior.
Types
@type opts() :: keyword()
Functions
Return the payload commonly passed into a browser-side authorizationCallback.
Generate a new MapKit JS JWT.
Return a MapKit JS JWT using the configured token cache behavior.