# `Apple.GameCenterAPI`
[🔗](https://github.com/cozy-elixir/apple/blob/v0.6.0/lib/apple/game_center_api.ex#L1)

Utilities for [Game Center API](https://developer.apple.com/documentation/gamekit).

The Game Center API allows server-side access to leaderboards, achievements,
and player data for games using Game Center.

# `base_url`

```elixir
@spec base_url() :: String.t()
```

Returns the Game Center API base URL.

# `build_auth_token!`

```elixir
@spec build_auth_token!(
  Apple.Types.GameCenter.team_id(),
  Apple.Types.GameCenter.key_id(),
  Apple.Types.GameCenter.private_key(),
  Apple.Types.GameCenter.bundle_id()
) :: String.t()
```

Builds a token to authorize Game Center API requests.

After building it, use it in the `Authorization` header like this:

```text
Authorization: Bearer <JWT>
```

## More resources

  * [Game Center API documentation](https://developer.apple.com/documentation/gamekit)
  * [Game Center Web API](https://developer.apple.com/documentation/gamecenter/game_center_web_api)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
