Nakama

Nakama by Heroic Labs is an open-source (Apache-2.0) game and app backend server providing user accounts and authentication, social features (friends, groups, chat), collaborative storage, realtime multiplayer and authoritative matches, matchmaking, leaderboards and tournaments, notifications, and a server runtime with custom RPCs in Go, TypeScript/JavaScript, and Lua. Nakama exposes a gRPC-gateway-generated REST API plus a realtime WebSocket socket API, and is available self-hosted or as the managed Heroic Cloud.

9 APIs 0 Features
GamingGame BackendBackendRealtimeMultiplayerMatchmakingLeaderboardsSocialOpen Source

APIs

Nakama Authentication API

Authenticates players and issues session tokens. Supports device ID, email/password, username, custom ID, Apple, Google, Facebook, Facebook Instant Games, Game Center, Steam, an...

Nakama Account API

Reads and updates the authenticated user's account, fetches other user profiles, deletes the account, and links or unlinks external identity providers (device, email, Apple, Goo...

Nakama Friends and Groups API

Manages the social graph - add, list, delete, and block friends; import friends from Facebook and Steam; create, update, list, join, and leave groups (clans); manage group membe...

Nakama Storage API

Reads, writes, lists, and deletes JSON storage objects organized into collections and keyed per user, with per-object owner and public read/write permissions and optimistic-conc...

Nakama Leaderboards and Tournaments API

Writes and lists leaderboard records (including records around an owner or filtered to friends), and lists, joins, and submits scores to recurring or one-off tournaments with co...

Nakama Notifications API

Lists and deletes a user's in-app notifications with cursor-based pagination. Notifications are delivered in realtime over the socket when the user is connected, and persisted f...

Nakama RPC and Runtime API

Invokes custom server-side functions (RPCs) registered in the Nakama runtime over HTTP GET or POST, callable with a session token or, for server-to-server calls, an HTTP key que...

Nakama Realtime Socket API

Persistent WebSocket connection carrying realtime features - status presence, realtime chat channels, relayed and authoritative multiplayer matches, matchmaking, parties, and re...

Nakama Console API

Administrative API behind the Nakama Developer Console for managing users, storage, leaderboards, matches, runtime configuration, and server status. It is an internal operations...

Collections

Nakama API

OPEN

Pricing Plans

Nakama Plans Pricing

3 plans

PLANS

Rate Limits

Nakama Rate Limits

5 limits

RATE LIMITS

FinOps

Nakama Finops

FINOPS

Event Specifications

Nakama Realtime Socket API (WebSocket)

AsyncAPI 2.6 description of Nakama's **realtime socket API**. Unlike the request/response REST surface (modeled in `openapi/nakama-openapi.yml`), Nakama exposes a genuine bidire...

ASYNCAPI

Resources

🔗
DomainSecurity
DomainSecurity
🔑
Authentication
Authentication
👥
GitHubOrganization
GitHubOrganization
🔗
LinkedIn
LinkedIn
🔗
Website
Website
🔗
Documentation
Documentation
🔗
Plans
Plans
🔗
RateLimits
RateLimits
🔗
FinOps
FinOps
📰
Blog
Blog

Sources

Raw ↑
opencollection: 1.0.0
info:
  name: Nakama API
  version: '2.0'
request:
  auth:
    type: bearer
    token: '{{sessionToken}}'
items:
- info:
    name: Authentication
    type: folder
  items:
  - info:
      name: Authenticate a user with a device id against the server.
      type: http
    http:
      method: POST
      url: http://127.0.0.1:7350/v2/account/authenticate/device
      body:
        type: json
        data: "{\n  \"id\": \"<device-id>\"\n}"
    docs: Authenticate a user with a device id. Guarded by the server key using HTTP Basic auth (server key as username, empty
      password).
  - info:
      name: Authenticate a user with an email and password against the server.
      type: http
    http:
      method: POST
      url: http://127.0.0.1:7350/v2/account/authenticate/email
      body:
        type: json
        data: "{\n  \"email\": \"user@example.com\",\n  \"password\": \"password123\"\n}"
    docs: Authenticate a user with an email and password. Uses server-key HTTP Basic auth.
  - info:
      name: Refresh a user's session using a refresh token.
      type: http
    http:
      method: POST
      url: http://127.0.0.1:7350/v2/account/session/refresh
      body:
        type: json
        data: "{\n  \"token\": \"<refresh-token>\"\n}"
    docs: Refresh a user's session using a refresh token retrieved from a previous authentication request.
- info:
    name: Account
    type: folder
  items:
  - info:
      name: Fetch the current user's account.
      type: http
    http:
      method: GET
      url: http://127.0.0.1:7350/v2/account
    docs: Fetch the current user's account.
  - info:
      name: Update fields in the current user's account.
      type: http
    http:
      method: PUT
      url: http://127.0.0.1:7350/v2/account
      body:
        type: json
        data: "{\n  \"display_name\": \"<string>\"\n}"
    docs: Update fields in the current user's account.
  - info:
      name: Fetch zero or more users by id, username, and/or Facebook id.
      type: http
    http:
      method: GET
      url: http://127.0.0.1:7350/v2/user
      params:
      - name: ids
        value: ''
        type: query
        description: The account ids of the users.
    docs: Fetch zero or more users by id, username, and/or Facebook id.
- info:
    name: Friends
    type: folder
  items:
  - info:
      name: List all friends for the current user.
      type: http
    http:
      method: GET
      url: http://127.0.0.1:7350/v2/friend
    docs: List all friends for the current user.
  - info:
      name: Add friends by ids or usernames.
      type: http
    http:
      method: POST
      url: http://127.0.0.1:7350/v2/friend
      params:
      - name: ids
        value: ''
        type: query
        description: The account ids of the users to add as friends.
    docs: Add friends by ids or usernames.
- info:
    name: Groups
    type: folder
  items:
  - info:
      name: Create a new group with the current user as the owner.
      type: http
    http:
      method: POST
      url: http://127.0.0.1:7350/v2/group
      body:
        type: json
        data: "{\n  \"name\": \"<string>\",\n  \"open\": true\n}"
    docs: Create a new group with the current user as the owner.
- info:
    name: Storage
    type: folder
  items:
  - info:
      name: Write objects into the storage engine.
      type: http
    http:
      method: PUT
      url: http://127.0.0.1:7350/v2/storage
      body:
        type: json
        data: "{\n  \"objects\": [\n    {\n      \"collection\": \"saves\",\n      \"key\": \"savegame\",\n      \"value\"\
          : \"{}\"\n    }\n  ]\n}"
    docs: Write objects into the storage engine.
  - info:
      name: Get objects from the storage engine.
      type: http
    http:
      method: POST
      url: http://127.0.0.1:7350/v2/storage
      body:
        type: json
        data: "{\n  \"object_ids\": [\n    {\n      \"collection\": \"saves\",\n      \"key\": \"savegame\"\n    }\n  ]\n}"
    docs: Get objects from the storage engine.
  - info:
      name: List publicly readable storage objects in a given collection.
      type: http
    http:
      method: GET
      url: http://127.0.0.1:7350/v2/storage/:collection
      params:
      - name: collection
        value: saves
        type: path
        description: The collection to list over.
    docs: List publicly readable storage objects in a given collection.
- info:
    name: Leaderboards
    type: folder
  items:
  - info:
      name: List records from a leaderboard.
      type: http
    http:
      method: GET
      url: http://127.0.0.1:7350/v2/leaderboard/:leaderboard_id
      params:
      - name: leaderboard_id
        value: ''
        type: path
        description: The leaderboard id.
    docs: List records from a leaderboard.
  - info:
      name: Write a record to a leaderboard.
      type: http
    http:
      method: POST
      url: http://127.0.0.1:7350/v2/leaderboard/:leaderboard_id
      params:
      - name: leaderboard_id
        value: ''
        type: path
        description: The leaderboard id.
      body:
        type: json
        data: "{\n  \"score\": \"100\"\n}"
    docs: Write a record to a leaderboard.
- info:
    name: Tournaments
    type: folder
  items:
  - info:
      name: List current or upcoming tournaments.
      type: http
    http:
      method: GET
      url: http://127.0.0.1:7350/v2/tournament
    docs: List current or upcoming tournaments.
  - info:
      name: Attempt to join an open and running tournament.
      type: http
    http:
      method: POST
      url: http://127.0.0.1:7350/v2/tournament/:tournament_id/join
      params:
      - name: tournament_id
        value: ''
        type: path
    docs: Attempt to join an open and running tournament.
- info:
    name: Notifications
    type: folder
  items:
  - info:
      name: Fetch a list of notifications.
      type: http
    http:
      method: GET
      url: http://127.0.0.1:7350/v2/notification
      params:
      - name: limit
        value: '10'
        type: query
        description: The number of notifications to get. Between 1 and 100.
    docs: Fetch a list of notifications.
  - info:
      name: Delete one or more notifications for the current user.
      type: http
    http:
      method: DELETE
      url: http://127.0.0.1:7350/v2/notification
      params:
      - name: ids
        value: ''
        type: query
        description: The id of notifications to delete.
    docs: Delete one or more notifications for the current user.
- info:
    name: RPC
    type: folder
  items:
  - info:
      name: Execute a Nakama runtime RPC function with a session token.
      type: http
    http:
      method: POST
      url: http://127.0.0.1:7350/v2/rpc/:id
      params:
      - name: id
        value: ''
        type: path
        description: The identifier of the runtime function.
      body:
        type: json
        data: '"{}"'
    docs: Execute a Nakama runtime RPC function registered in the server framework.
bundled: true