Module nakama
The Nakama client SDK for Defold.
Functions
Fields
| APIOPERATOR_NO_OVERRIDE | api_operator Operator that can be used to override the one set in the leaderboard. |
| APISTOREENVIRONMENT_UNKNOWN | api_store_environment - UNKNOWN: Unknown environment. |
| APISTOREPROVIDER_APPLE_APP_STORE | api_store_provider - APPLE_APP_STORE: Apple App Store - GOOGLE_PLAY_STORE: Google Play Store - HUAWEI_APP_GALLERY: Huawei App Gallery - FACEBOOK_INSTANT_STORE: Facebook Instant Store |
| client | update_account Update fields in the current user's account. |
| client | authenticate_apple Authenticate a user with an Apple ID against the server. |
| client | authenticate_custom Authenticate a user with a custom id against the server. |
| client | authenticate_device Authenticate a user with a device id against the server. |
| client | authenticate_email Authenticate a user with an email+password against the server. |
| client | authenticate_facebook Authenticate a user with a Facebook OAuth token against the server. |
| client | authenticate_facebook_instant_game Authenticate a user with a Facebook Instant Game token against the server. |
| client | authenticate_game_center Authenticate a user with Apple's GameCenter against the server. |
| client | authenticate_google Authenticate a user with Google against the server. |
| client | authenticate_steam Authenticate a user with Steam against the server. |
| client | link_apple Add an Apple ID to the social profiles on the current user's account. |
| client | link_custom Add a custom ID to the social profiles on the current user's account. |
| client | link_device Add a device ID to the social profiles on the current user's account. |
| client | link_email Add an email+password to the social profiles on the current user's account. |
| client | link_facebook Add Facebook to the social profiles on the current user's account. |
| client | link_facebook_instant_game Add Facebook Instant Game to the social profiles on the current user's account. |
| client | link_game_center Add Apple's GameCenter to the social profiles on the current user's account. |
| client | link_google Add Google to the social profiles on the current user's account. |
| client | link_steam Add Steam to the social profiles on the current user's account. |
| client | session_refresh Refresh a user's session using a refresh token retrieved from a previous authentication request. |
| client | unlink_apple Remove the Apple ID from the social profiles on the current user's account. |
| client | unlink_custom Remove the custom ID from the social profiles on the current user's account. |
| client | unlink_device Remove the device ID from the social profiles on the current user's account. |
| client | unlink_email Remove the email+password from the social profiles on the current user's account. |
| client | unlink_facebook Remove Facebook from the social profiles on the current user's account. |
| client | unlink_facebook_instant_game Remove Facebook Instant Game profile from the social profiles on the current user's account. |
| client | unlink_game_center Remove Apple's GameCenter from the social profiles on the current user's account. |
| client | unlink_google Remove Google from the social profiles on the current user's account. |
| client | unlink_steam Remove Steam from the social profiles on the current user's account. |
| client | event Submit an event for processing in the server's registered runtime custom events handler. |
| client | import_facebook_friends Import Facebook friends and add them to a user's account. |
| client | import_steam_friends Import Steam friends and add them to a user's account. |
| client | create_group Create a new group with the current user as the owner. |
| client | validate_purchase_apple Validate Apple IAP Receipt |
| client | validate_purchase_facebook_instant Validate FB Instant IAP Receipt |
| client | validate_purchase_google Validate Google IAP Receipt |
| client | validate_purchase_huawei Validate Huawei IAP Receipt |
| client | list_subscriptions List user's subscriptions. |
| client | validate_subscription_apple Validate Apple Subscription Receipt |
| client | validate_subscription_google Validate Google Subscription Receipt |
| client | write_leaderboard_record Write a record to a leaderboard. |
| client | session_logout Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user. |
| client | read_storage_objects Get storage objects. |
| client | write_storage_objects Write objects into the storage engine. |
| client | delete_storage_objects Delete one or more objects by ID or username. |
| client | write_tournament_record2 Write a record to a tournament. |
| client | write_tournament_record Write a record to a tournament. |
Functions
- create_group_user_list_group_user (state_int, user_api_user)
-
create_group_user_list_group_user
A single user-role pair.
Parameters:
- state_int (number) Their relationship to the group.
- user_api_user (table) User.
- create_user_group_list_user_group (group_api_group, state_int)
-
create_user_group_list_user_group
A single group-role pair.
Parameters:
- group_api_group (table) Group.
- state_int (number) The user's relationship to the group.
- create_write_leaderboard_record_request_leaderboard_record_write (metadata_str, operator_api_operator, score_str, subscore_str)
-
create_write_leaderboard_record_request_leaderboard_record_write
Record values to write.
Parameters:
- metadata_str (string) Optional record metadata.
- operator_api_operator (string) Operator override.
- score_str (string) The score value to submit.
- subscore_str (string) An optional secondary value.
- create_write_tournament_record_request_tournament_record_write (metadata_str, operator_api_operator, score_str, subscore_str)
-
create_write_tournament_record_request_tournament_record_write
Record values to write.
Parameters:
- metadata_str (string) A JSON object of additional properties (optional).
- operator_api_operator (string) Operator override.
- score_str (string) The score value to submit.
- subscore_str (string) An optional secondary value.
- create_api_account (custom_id_str, devices_arr, disable_time_str, email_str, user_api_user, verify_time_str, wallet_str)
-
create_api_account
A user with additional account details. Always the current user.
Parameters:
- custom_id_str (string) The custom id in the user's account.
- devices_arr (table) The devices which belong to the user's account.
- disable_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the user's account was disabled/banned.
- email_str (string) The email address of the user.
- user_api_user (table) The user object.
- verify_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the user's email was verified.
- wallet_str (string) The user's wallet data.
- create_api_account_apple (token_str, vars_obj)
-
create_api_account_apple
Send a Apple Sign In token to the server. Used with authenticate/link/unlink.
Parameters:
- token_str (string) The ID token received from Apple to validate.
- vars_obj (table) Extra information that will be bundled in the session token.
- create_api_account_custom (id_str, vars_obj)
-
create_api_account_custom
Send a custom ID to the server. Used with authenticate/link/unlink.
Parameters:
- id_str (string) A custom identifier.
- vars_obj (table) Extra information that will be bundled in the session token.
- create_api_account_device (id_str, vars_obj)
-
create_api_account_device
Send a device to the server. Used with authenticate/link/unlink and user.
Parameters:
- id_str (string) A device identifier. Should be obtained by a platform-specific device API.
- vars_obj (table) Extra information that will be bundled in the session token.
- create_api_account_email (email_str, password_str, vars_obj)
-
create_api_account_email
Send an email with password to the server. Used with authenticate/link/unlink.
Parameters:
- email_str (string) A valid RFC-5322 email address.
- password_str
(string) A password for the user account.
Ignored with unlink operations.
- vars_obj (table) Extra information that will be bundled in the session token.
- create_api_account_facebook (token_str, vars_obj)
-
create_api_account_facebook
Send a Facebook token to the server. Used with authenticate/link/unlink.
Parameters:
- token_str (string) The OAuth token received from Facebook to access their profile API.
- vars_obj (table) Extra information that will be bundled in the session token.
- create_api_account_facebook_instant_game (signed_player_info_str, vars_obj)
-
create_api_account_facebook_instant_game
Send a Facebook Instant Game token to the server. Used with authenticate/link/unlink.
Parameters:
- signed_player_info_str (string)
- vars_obj (table) Extra information that will be bundled in the session token.
- create_api_account_game_center (bundle_id_str, player_id_str, public_key_url_str, salt_str, signature_str, timestamp_seconds_str, vars_obj)
-
create_api_account_game_center
Send Apple's Game Center account credentials to the server. Used with authenticate/link/unlink.
https://developer.apple.com/documentation/gamekit/gklocalplayer/1515407-generateidentityverificationsign
Parameters:
- bundle_id_str (string) Bundle ID (generated by GameCenter).
- player_id_str (string) Player ID (generated by GameCenter).
- public_key_url_str (string) The URL for the public encryption key.
- salt_str (string) A random "NSString" used to compute the hash and keep it randomized.
- signature_str (string) The verification signature data generated.
- timestamp_seconds_str (string) Time since UNIX epoch when the signature was created.
- vars_obj (table) Extra information that will be bundled in the session token.
- create_api_account_google (token_str, vars_obj)
-
create_api_account_google
Send a Google token to the server. Used with authenticate/link/unlink.
Parameters:
- token_str (string) The OAuth token received from Google to access their profile API.
- vars_obj (table) Extra information that will be bundled in the session token.
- create_api_account_steam (token_str, vars_obj)
-
create_api_account_steam
Send a Steam token to the server. Used with authenticate/link/unlink.
Parameters:
- token_str (string) The account token received from Steam to access their profile API.
- vars_obj (table) Extra information that will be bundled in the session token.
- create_api_channel_message (channel_id_str, code_int, content_str, create_time_str, group_id_str, message_id_str, persistent_bool, room_name_str, sender_id_str, update_time_str, user_id_one_str, user_id_two_str, username_str)
-
create_api_channel_message
A message sent on a channel.
Parameters:
- channel_id_str (string) The channel this message belongs to.
- code_int (number) The code representing a message type or category.
- content_str (string) The content payload.
- create_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the message was created.
- group_id_str (string) The ID of the group, or an empty string if this message was not sent through a group channel.
- message_id_str (string) The unique ID of this message.
- persistent_bool (boolean) True if the message was persisted to the channel's history, false otherwise.
- room_name_str (string) The name of the chat room, or an empty string if this message was not sent through a chat room.
- sender_id_str (string) Message sender, usually a user ID.
- update_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the message was last updated.
- user_id_one_str (string) The ID of the first DM user, or an empty string if this message was not sent through a DM chat.
- user_id_two_str (string) The ID of the second DM user, or an empty string if this message was not sent through a DM chat.
- username_str (string) The username of the message sender, if any.
- create_api_channel_message_list (cacheable_cursor_str, messages_arr, next_cursor_str, prev_cursor_str)
-
create_api_channel_message_list
A list of channel messages, usually a result of a list operation.
Parameters:
- cacheable_cursor_str (string) Cacheable cursor to list newer messages. Durable and designed to be stored, unlike next/prev cursors.
- messages_arr (table) A list of messages.
- next_cursor_str (string) The cursor to send when retrieving the next page, if any.
- prev_cursor_str (string) The cursor to send when retrieving the previous page, if any.
- create_api_create_group_request (avatar_url_str, description_str, lang_tag_str, max_count_int, name_str, open_bool)
-
create_api_create_group_request
Create a group with the current user as owner.
Parameters:
- avatar_url_str (string) A URL for an avatar image.
- description_str (string) A description for the group.
- lang_tag_str (string) The language expected to be a tag which follows the BCP-47 spec.
- max_count_int (number) Maximum number of group members.
- name_str (string) A unique name for the group.
- open_bool (boolean) Mark a group as open or not where only admins can accept members.
- create_api_delete_storage_object_id (collection_str, key_str, version_str)
-
create_api_delete_storage_object_id
Storage objects to delete.
Parameters:
- collection_str (string) The collection which stores the object.
- key_str (string) The key of the object within the collection.
- version_str (string) The version hash of the object.
- create_api_delete_storage_objects_request (object_ids_arr)
-
create_api_delete_storage_objects_request
Batch delete storage objects.
Parameters:
- object_ids_arr (table) Batch of storage objects.
- create_api_event (external_bool, name_str, properties_obj, timestamp_str)
-
create_api_event
Represents an event to be passed through the server to registered event handlers.
Parameters:
- external_bool (boolean) True if the event came directly from a client call, false otherwise.
- name_str (string) An event name, type, category, or identifier.
- properties_obj (table) Arbitrary event property values.
- timestamp_str (string) The time when the event was triggered.
- create_api_friend (state_int, update_time_str, user_api_user)
-
create_api_friend
A friend of a user.
Parameters:
- state_int
(number) The friend status.
one of "Friend.State".
- update_time_str (string) Time of the latest relationship update.
- user_api_user (table) The user object.
- state_int
(number) The friend status.
- create_api_friend_list (cursor_str, friends_arr)
-
create_api_friend_list
A collection of zero or more friends of the user.
Parameters:
- cursor_str (string) Cursor for the next page of results, if any.
- friends_arr (table) The Friend objects.
- create_api_group (avatar_url_str, create_time_str, creator_id_str, description_str, edge_count_int, id_str, lang_tag_str, max_count_int, metadata_str, name_str, open_bool, update_time_str)
-
create_api_group
A group in the server.
Parameters:
- avatar_url_str (string) A URL for an avatar image.
- create_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the group was created.
- creator_id_str (string) The id of the user who created the group.
- description_str (string) A description for the group.
- edge_count_int (number) The current count of all members in the group.
- id_str (string) The id of a group.
- lang_tag_str (string) The language expected to be a tag which follows the BCP-47 spec.
- max_count_int (number) The maximum number of members allowed.
- metadata_str (string) Additional information stored as a JSON object.
- name_str (string) The unique name of the group.
- open_bool (boolean) Anyone can join open groups, otherwise only admins can accept members.
- update_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the group was last updated.
- create_api_group_list (cursor_str, groups_arr)
-
create_api_group_list
One or more groups returned from a listing operation.
Parameters:
- cursor_str (string) A cursor used to get the next page.
- groups_arr (table) One or more groups.
- create_api_group_user_list (cursor_str, group_users_arr)
-
create_api_group_user_list
A list of users belonging to a group, along with their role.
Parameters:
- cursor_str (string) Cursor for the next page of results, if any.
- group_users_arr (table) User-role pairs for a group.
- create_api_leaderboard_record (create_time_str, expiry_time_str, leaderboard_id_str, max_num_score_int, metadata_str, num_score_int, owner_id_str, rank_str, score_str, subscore_str, update_time_str, username_str)
-
create_api_leaderboard_record
Represents a complete leaderboard record with all scores and associated metadata.
Parameters:
- create_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the leaderboard record was created.
- expiry_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the leaderboard record expires.
- leaderboard_id_str (string) The ID of the leaderboard this score belongs to.
- max_num_score_int (number) The maximum number of score updates allowed by the owner.
- metadata_str (string) Metadata.
- num_score_int (number) The number of submissions to this score record.
- owner_id_str (string) The ID of the score owner, usually a user or group.
- rank_str (string) The rank of this record.
- score_str (string) The score value.
- subscore_str (string) An optional subscore value.
- update_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the leaderboard record was updated.
- username_str (string) The username of the score owner, if the owner is a user.
- create_api_leaderboard_record_list (next_cursor_str, owner_records_arr, prev_cursor_str, rank_count_str, records_arr)
-
create_api_leaderboard_record_list
A set of leaderboard records, may be part of a leaderboard records page or a batch of individual records.
Parameters:
- next_cursor_str (string) The cursor to send when retrieving the next page, if any.
- owner_records_arr (table) A batched set of leaderboard records belonging to specified owners.
- prev_cursor_str (string) The cursor to send when retrieving the previous page, if any.
- rank_count_str (string) The total number of ranks available.
- records_arr (table) A list of leaderboard records.
- create_api_link_steam_request (account_api_account_steam, sync_bool)
-
create_api_link_steam_request
Link Steam to the current user's account.
Parameters:
- account_api_account_steam (table) The Facebook account details.
- sync_bool (boolean) Import Steam friends for the user.
- create_api_list_subscriptions_request (cursor_str, limit_int)
-
create_api_list_subscriptions_request
List user subscriptions.
Parameters:
- cursor_str (string)
- limit_int (number)
- create_api_match (authoritative_bool, handler_name_str, label_str, match_id_str, size_int, tick_rate_int)
-
create_api_match
Represents a realtime match.
Parameters:
- authoritative_bool (boolean) True if it's an server-managed authoritative match, false otherwise.
- handler_name_str (string)
- label_str (string) Match label, if any.
- match_id_str (string) The ID of the match, can be used to join.
- size_int (number) Current number of users in the match.
- tick_rate_int (number)
- create_api_match_list (matches_arr)
-
create_api_match_list
A list of realtime matches.
Parameters:
- matches_arr (table) A number of matches corresponding to a list operation.
- create_api_notification (code_int, content_str, create_time_str, id_str, persistent_bool, sender_id_str, subject_str)
-
create_api_notification
A notification in the server.
Parameters:
- code_int (number) Category code for this notification.
- content_str (string) Content of the notification in JSON.
- create_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the notification was created.
- id_str (string) ID of the Notification.
- persistent_bool (boolean) True if this notification was persisted to the database.
- sender_id_str (string) ID of the sender, if a user. Otherwise 'null'.
- subject_str (string) Subject of the notification.
- create_api_notification_list (cacheable_cursor_str, notifications_arr)
-
create_api_notification_list
A collection of zero or more notifications.
Parameters:
- cacheable_cursor_str (string) Use this cursor to paginate notifications. Cache this to catch up to new notifications.
- notifications_arr (table) Collection of notifications.
- create_api_read_storage_object_id (collection_str, key_str, user_id_str)
-
create_api_read_storage_object_id
Storage objects to get.
Parameters:
- collection_str (string) The collection which stores the object.
- key_str (string) The key of the object within the collection.
- user_id_str (string) The user owner of the object.
- create_api_read_storage_objects_request (object_ids_arr)
-
create_api_read_storage_objects_request
Batch get storage objects.
Parameters:
- object_ids_arr (table) Batch of storage objects.
- create_api_rpc (http_key_str, id_str, payload_str)
-
create_api_rpc
Execute an Lua function on the server.
Parameters:
- http_key_str (string) The authentication key used when executed as a non-client HTTP request.
- id_str (string) The identifier of the function.
- payload_str (string) The payload of the function which must be a JSON object.
- create_api_session (created_bool, refresh_token_str, token_str)
-
create_api_session
A user's session used to authenticate messages.
Parameters:
- created_bool (boolean) True if the corresponding account was just created, false otherwise.
- refresh_token_str (string) Refresh token that can be used for session token renewal.
- token_str (string) Authentication credentials.
- create_api_session_logout_request (refresh_token_str, token_str)
-
create_api_session_logout_request
Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user.
Parameters:
- refresh_token_str (string) Refresh token to invalidate.
- token_str (string) Session token to log out.
- create_api_session_refresh_request (token_str, vars_obj)
-
create_api_session_refresh_request
Authenticate against the server with a refresh token.
Parameters:
- token_str (string) Refresh token.
- vars_obj (table) Extra information that will be bundled in the session token.
- create_api_storage_object (collection_str, create_time_str, key_str, permission_read_int, permission_write_int, update_time_str, user_id_str, value_str, version_str)
-
create_api_storage_object
An object within the storage engine.
Parameters:
- collection_str (string) The collection which stores the object.
- create_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the object was created.
- key_str (string) The key of the object within the collection.
- permission_read_int (number) The read access permissions for the object.
- permission_write_int (number) The write access permissions for the object.
- update_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the object was last updated.
- user_id_str (string) The user owner of the object.
- value_str (string) The value of the object.
- version_str (string) The version hash of the object.
- create_api_storage_object_ack (collection_str, create_time_str, key_str, update_time_str, user_id_str, version_str)
-
create_api_storage_object_ack
A storage acknowledgement.
Parameters:
- collection_str (string) The collection which stores the object.
- create_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the object was created.
- key_str (string) The key of the object within the collection.
- update_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the object was last updated.
- user_id_str (string) The owner of the object.
- version_str (string) The version hash of the object.
- create_api_storage_object_acks (acks_arr)
-
create_api_storage_object_acks
Batch of acknowledgements for the storage object write.
Parameters:
- acks_arr (table) Batch of storage write acknowledgements.
- create_api_storage_object_list (cursor_str, objects_arr)
-
create_api_storage_object_list
List of storage objects.
Parameters:
- cursor_str (string) The cursor for the next page of results, if any.
- objects_arr (table) The list of storage objects.
- create_api_storage_objects (objects_arr)
-
create_api_storage_objects
Batch of storage objects.
Parameters:
- objects_arr (table) The batch of storage objects.
- create_api_subscription_list (cursor_str, prev_cursor_str, validated_subscriptions_arr)
-
create_api_subscription_list
A list of validated subscriptions stored by Nakama.
Parameters:
- cursor_str (string) The cursor to send when retrieving the next page, if any.
- prev_cursor_str (string) The cursor to send when retrieving the previous page, if any.
- validated_subscriptions_arr (table) Stored validated subscriptions.
- create_api_tournament (authoritative_bool, can_enter_bool, category_int, create_time_str, description_str, duration_int, end_active_int, end_time_str, id_str, max_num_score_int, max_size_int, metadata_str, next_reset_int, operator_api_operator, prev_reset_int, size_int, sort_order_int, start_active_int, start_time_str, title_str)
-
create_api_tournament
A tournament on the server.
Parameters:
- authoritative_bool (boolean) Whether the leaderboard was created authoritatively or not.
- can_enter_bool (boolean) True if the tournament is active and can enter. A computed value.
- category_int (number) The category of the tournament. e.g. "vip" could be category 1.
- create_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the tournament was created.
- description_str (string) The description of the tournament. May be blank.
- duration_int (number) Duration of the tournament in seconds.
- end_active_int (number) The UNIX time when the tournament stops being active until next reset. A computed value.
- end_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the tournament will be stopped.
- id_str (string) The ID of the tournament.
- max_num_score_int (number) The maximum score updates allowed per player for the current tournament.
- max_size_int (number) The maximum number of players for the tournament.
- metadata_str (string) Additional information stored as a JSON object.
- next_reset_int (number) The UNIX time when the tournament is next playable. A computed value.
- operator_api_operator (string) Operator.
- prev_reset_int (number) The UNIX time when the tournament was last reset. A computed value.
- size_int (number) The current number of players in the tournament.
- sort_order_int (number) ASC (0) or DESC (1) sort mode of scores in the tournament.
- start_active_int (number) The UNIX time when the tournament start being active. A computed value.
- start_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the tournament will start.
- title_str (string) The title for the tournament.
- create_api_tournament_list (cursor_str, tournaments_arr)
-
create_api_tournament_list
A list of tournaments.
Parameters:
- cursor_str (string) A pagination cursor (optional).
- tournaments_arr (table) The list of tournaments returned.
- create_api_tournament_record_list (next_cursor_str, owner_records_arr, prev_cursor_str, rank_count_str, records_arr)
-
create_api_tournament_record_list
A set of tournament records which may be part of a tournament records page or a batch of individual records.
Parameters:
- next_cursor_str (string) The cursor to send when retireving the next page (optional).
- owner_records_arr (table) A batched set of tournament records belonging to specified owners.
- prev_cursor_str (string) The cursor to send when retrieving the previous page (optional).
- rank_count_str (string) The total number of ranks available.
- records_arr (table) A list of tournament records.
- create_api_update_account_request (avatar_url_str, display_name_str, lang_tag_str, location_str, timezone_str, username_str)
-
create_api_update_account_request
Update a user's account details.
Parameters:
- avatar_url_str (string) A URL for an avatar image.
- display_name_str (string) The display name of the user.
- lang_tag_str (string) The language expected to be a tag which follows the BCP-47 spec.
- location_str (string) The location set by the user.
- timezone_str (string) The timezone set by the user.
- username_str (string) The username of the user's account.
- create_api_user (apple_id_str, avatar_url_str, create_time_str, display_name_str, edge_count_int, facebook_id_str, facebook_instant_game_id_str, gamecenter_id_str, google_id_str, id_str, lang_tag_str, location_str, metadata_str, online_bool, steam_id_str, timezone_str, update_time_str, username_str)
-
create_api_user
A user in the server.
Parameters:
- apple_id_str (string) The Apple Sign In ID in the user's account.
- avatar_url_str (string) A URL for an avatar image.
- create_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the user was created.
- display_name_str (string) The display name of the user.
- edge_count_int (number) Number of related edges to this user.
- facebook_id_str (string) The Facebook id in the user's account.
- facebook_instant_game_id_str (string) The Facebook Instant Game ID in the user's account.
- gamecenter_id_str (string) The Apple Game Center in of the user's account.
- google_id_str (string) The Google id in the user's account.
- id_str (string) The id of the user's account.
- lang_tag_str (string) The language expected to be a tag which follows the BCP-47 spec.
- location_str (string) The location set by the user.
- metadata_str (string) Additional information stored as a JSON object.
- online_bool (boolean) Indicates whether the user is currently online.
- steam_id_str (string) The Steam id in the user's account.
- timezone_str (string) The timezone set by the user.
- update_time_str (string) The UNIX time (for gRPC clients) or ISO string (for REST clients) when the user was last updated.
- username_str (string) The username of the user's account.
- create_api_user_group_list (cursor_str, user_groups_arr)
-
create_api_user_group_list
A list of groups belonging to a user, along with the user's role in each group.
Parameters:
- cursor_str (string) Cursor for the next page of results, if any.
- user_groups_arr (table) Group-role pairs for a user.
- create_api_users (users_arr)
-
create_api_users
A collection of zero or more users.
Parameters:
- users_arr (table) The User objects.
- create_api_validate_purchase_apple_request (persist_bool, receipt_str)
-
create_api_validate_purchase_apple_request
Parameters:
- persist_bool (boolean)
- receipt_str (string) Base64 encoded Apple receipt data payload.
- create_api_validate_purchase_facebook_instant_request (persist_bool, signed_request_str)
-
create_api_validate_purchase_facebook_instant_request
Parameters:
- persist_bool (boolean)
- signed_request_str (string) Base64 encoded Facebook Instant signedRequest receipt data payload.
- create_api_validate_purchase_google_request (persist_bool, purchase_str)
-
create_api_validate_purchase_google_request
Parameters:
- persist_bool (boolean)
- purchase_str (string) JSON encoded Google purchase payload.
- create_api_validate_purchase_huawei_request (persist_bool, purchase_str, signature_str)
-
create_api_validate_purchase_huawei_request
Parameters:
- persist_bool (boolean)
- purchase_str (string) JSON encoded Huawei InAppPurchaseData.
- signature_str (string) InAppPurchaseData signature.
- create_api_validate_purchase_response (validated_purchases_arr)
-
create_api_validate_purchase_response
Validate IAP response.
Parameters:
- validated_purchases_arr (table) Newly seen validated purchases.
- create_api_validate_subscription_apple_request (persist_bool, receipt_str)
-
create_api_validate_subscription_apple_request
Parameters:
- persist_bool (boolean) Persist the subscription.
- receipt_str (string) Base64 encoded Apple receipt data payload.
- create_api_validate_subscription_google_request (persist_bool, receipt_str)
-
create_api_validate_subscription_google_request
Parameters:
- persist_bool (boolean) Persist the subscription.
- receipt_str (string) JSON encoded Google purchase payload.
- create_api_validate_subscription_response (validated_subscription_api_validated_subscription)
-
create_api_validate_subscription_response
Validate Subscription response.
Parameters:
- validated_subscription_api_validated_subscription (table)
- create_api_validated_purchase (create_time_str, environment_api_store_environment, product_id_str, provider_response_str, purchase_time_str, refund_time_str, seen_before_bool, store_api_store_provider, transaction_id_str, update_time_str, user_id_str)
-
create_api_validated_purchase
Validated Purchase stored by Nakama.
Parameters:
- create_time_str (string) Timestamp when the receipt validation was stored in DB.
- environment_api_store_environment (string) Whether the purchase was done in production or sandbox environment.
- product_id_str (string) Purchase Product ID.
- provider_response_str (string) Raw provider validation response.
- purchase_time_str (string) Timestamp when the purchase was done.
- refund_time_str (string)
- seen_before_bool (boolean) Whether the purchase had already been validated by Nakama before.
- store_api_store_provider (string)
- transaction_id_str (string) Purchase Transaction ID.
- update_time_str (string) Timestamp when the receipt validation was updated in DB.
- user_id_str (string) Purchase User ID.
- create_api_validated_subscription (active_bool, create_time_str, environment_api_store_environment, expiry_time_str, original_transaction_id_str, product_id_str, provider_notification_str, provider_response_str, purchase_time_str, refund_time_str, store_api_store_provider, update_time_str, user_id_str)
-
create_api_validated_subscription
Parameters:
- active_bool (boolean) Whether the subscription is currently active or not.
- create_time_str (string) UNIX Timestamp when the receipt validation was stored in DB.
- environment_api_store_environment (string) Whether the purchase was done in production or sandbox environment.
- expiry_time_str (string) Subscription expiration time. The subscription can still be auto-renewed to extend the expiration time further.
- original_transaction_id_str (string) Purchase Original transaction ID (we only keep track of the original subscription, not subsequent renewals).
- product_id_str (string) Purchase Product ID.
- provider_notification_str (string) Raw provider notification body.
- provider_response_str (string) Raw provider validation response body.
- purchase_time_str (string) UNIX Timestamp when the purchase was done.
- refund_time_str (string) Subscription refund time. If this time is set, the subscription was refunded.
- store_api_store_provider (string)
- update_time_str (string) UNIX Timestamp when the receipt validation was updated in DB.
- user_id_str (string) Subscription User ID.
- create_api_write_storage_object (collection_str, key_str, permission_read_int, permission_write_int, value_str, version_str)
-
create_api_write_storage_object
The object to store.
Parameters:
- collection_str (string) The collection to store the object.
- key_str (string) The key for the object within the collection.
- permission_read_int (number) The read access permissions for the object.
- permission_write_int (number) The write access permissions for the object.
- value_str (string) The value of the object.
- version_str
(string) The version hash of the object to check. Possible values are: ["", "*", "#hash#"].
if-match and if-none-match
- create_api_write_storage_objects_request (objects_arr)
-
create_api_write_storage_objects_request
Write objects to the storage engine.
Parameters:
- objects_arr (table) The objects to store on the server.
- create_protobuf_any (type_str)
-
create_protobuf_any
Parameters:
- type_str (string)
- create_rpc_status (code_int, details_arr, message_str)
-
create_rpc_status
Parameters:
- code_int (number)
- details_arr (table)
- message_str (string)
- healthcheck (client, callback, retry_policy, cancellation_token)
-
healthcheck
A healthcheck which load balancers can use to check the service.
Parameters:
- client Client.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- delete_account (client, callback, retry_policy, cancellation_token)
-
delete_account
Delete the current user's account.
Parameters:
- client Client.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- get_account (client, callback, retry_policy, cancellation_token)
-
get_account
Fetch the current user's account.
Parameters:
- client Client.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_channel_messages (client, channel_id_str, limit_int, forward_bool, cursor_str, callback, retry_policy, cancellation_token)
-
list_channel_messages
List a channel's message history.
Parameters:
- client Client.
- channel_id_str () The channel ID to list from.
- limit_int () Max number of records to return. Between 1 and 100.
- forward_bool () True if listing should be older messages to newer, false if reverse.
- cursor_str () A pagination cursor, if any.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- delete_friends (client, ids_arr, usernames_arr, callback, retry_policy, cancellation_token)
-
delete_friends
Delete one or more users by ID or username.
Parameters:
- client Client.
- ids_arr () The account id of a user.
- usernames_arr () The account username of a user.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_friends (client, limit_int, state_int, cursor_str, callback, retry_policy, cancellation_token)
-
list_friends
List all friends for the current user.
Parameters:
- client Client.
- limit_int () Max number of records to return. Between 1 and 100.
- state_int () The friend state to list.
- cursor_str () An optional next page cursor.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- add_friends (client, ids_arr, usernames_arr, callback, retry_policy, cancellation_token)
-
add_friends
Add friends by ID or username to a user's account.
Parameters:
- client Client.
- ids_arr () The account id of a user.
- usernames_arr () The account username of a user.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- block_friends (client, ids_arr, usernames_arr, callback, retry_policy, cancellation_token)
-
block_friends
Block one or more users by ID or username.
Parameters:
- client Client.
- ids_arr () The account id of a user.
- usernames_arr () The account username of a user.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_groups (client, name_str, cursor_str, limit_int, lang_tag_str, members_int, open_bool, callback, retry_policy, cancellation_token)
-
list_groups
List groups based on given filters.
Parameters:
- client Client.
- name_str () List groups that contain this value in their names.
- cursor_str () Optional pagination cursor.
- limit_int () Max number of groups to return. Between 1 and 100.
- lang_tag_str () Language tag filter
- members_int () Number of group members
- open_bool () Optional Open/Closed filter.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- delete_group (client, group_id_str, callback, retry_policy, cancellation_token)
-
delete_group
Delete a group by ID.
Parameters:
- client Client.
- group_id_str () The id of a group.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- update_group (client, group_id_str, body, callback, retry_policy, cancellation_token)
-
update_group
Update fields in a given group.
Parameters:
- client Client.
- group_id_str () The ID of the group to update.
- body (object)
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- add_group_users (client, group_id_str, user_ids_arr, callback, retry_policy, cancellation_token)
-
add_group_users
Add users to a group.
Parameters:
- client Client.
- group_id_str () The group to add users to.
- user_ids_arr () The users to add.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- ban_group_users (client, group_id_str, user_ids_arr, callback, retry_policy, cancellation_token)
-
ban_group_users
Ban a set of users from a group.
Parameters:
- client Client.
- group_id_str () The group to ban users from.
- user_ids_arr () The users to ban.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- demote_group_users (client, group_id_str, user_ids_arr, callback, retry_policy, cancellation_token)
-
demote_group_users
Demote a set of users in a group to the next role down.
Parameters:
- client Client.
- group_id_str () The group ID to demote in.
- user_ids_arr () The users to demote.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- join_group (client, group_id_str, callback, retry_policy, cancellation_token)
-
join_group
Immediately join an open group, or request to join a closed one.
Parameters:
- client Client.
- group_id_str () The group ID to join. The group must already exist.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- kick_group_users (client, group_id_str, user_ids_arr, callback, retry_policy, cancellation_token)
-
kick_group_users
Kick a set of users from a group.
Parameters:
- client Client.
- group_id_str () The group ID to kick from.
- user_ids_arr () The users to kick.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- leave_group (client, group_id_str, callback, retry_policy, cancellation_token)
-
leave_group
Leave a group the user is a member of.
Parameters:
- client Client.
- group_id_str () The group ID to leave.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- promote_group_users (client, group_id_str, user_ids_arr, callback, retry_policy, cancellation_token)
-
promote_group_users
Promote a set of users in a group to the next role up.
Parameters:
- client Client.
- group_id_str () The group ID to promote in.
- user_ids_arr () The users to promote.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_group_users (client, group_id_str, limit_int, state_int, cursor_str, callback, retry_policy, cancellation_token)
-
list_group_users
List all users that are part of a group.
Parameters:
- client Client.
- group_id_str () The group ID to list from.
- limit_int () Max number of records to return. Between 1 and 100.
- state_int () The group user state to list.
- cursor_str () An optional next page cursor.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- get_subscription (client, product_id_str, callback, retry_policy, cancellation_token)
-
get_subscription
Get subscription by product id.
Parameters:
- client Client.
- product_id_str () Product id of the subscription
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- delete_leaderboard_record (client, leaderboard_id_str, callback, retry_policy, cancellation_token)
-
delete_leaderboard_record
Delete a leaderboard record.
Parameters:
- client Client.
- leaderboard_id_str () The leaderboard ID to delete from.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_leaderboard_records (client, leaderboard_id_str, owner_ids_arr, limit_int, cursor_str, expiry_str, callback, retry_policy, cancellation_token)
-
list_leaderboard_records
List leaderboard records.
Parameters:
- client Client.
- leaderboard_id_str () The ID of the leaderboard to list for.
- owner_ids_arr () One or more owners to retrieve records for.
- limit_int () Max number of records to return. Between 1 and 100.
- cursor_str () A next or previous page cursor.
- expiry_str () Expiry in seconds (since epoch) to begin fetching records from. Optional. 0 means from current time.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_leaderboard_records_around_owner (client, leaderboard_id_str, owner_id_str, limit_int, expiry_str, cursor_str, callback, retry_policy, cancellation_token)
-
list_leaderboard_records_around_owner
List leaderboard records that belong to a user.
Parameters:
- client Client.
- leaderboard_id_str () The ID of the tournament to list for.
- owner_id_str () The owner to retrieve records around.
- limit_int () Max number of records to return. Between 1 and 100.
- expiry_str () Expiry in seconds (since epoch) to begin fetching records from.
- cursor_str () A next or previous page cursor.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_matches (client, limit_int, authoritative_bool, label_str, min_size_int, max_size_int, query_str, callback, retry_policy, cancellation_token)
-
list_matches
Fetch list of running matches.
Parameters:
- client Client.
- limit_int () Limit the number of returned matches.
- authoritative_bool () Authoritative or relayed matches.
- label_str () Label filter.
- min_size_int () Minimum user count.
- max_size_int () Maximum user count.
- query_str () Arbitrary label query.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- delete_notifications (client, ids_arr, callback, retry_policy, cancellation_token)
-
delete_notifications
Delete one or more notifications for the current user.
Parameters:
- client Client.
- ids_arr () The id of notifications.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_notifications (client, limit_int, cacheable_cursor_str, callback, retry_policy, cancellation_token)
-
list_notifications
Fetch list of notifications.
Parameters:
- client Client.
- limit_int () The number of notifications to get. Between 1 and 100.
- cacheable_cursor_str
() A cursor to page through notifications. May be cached by clients to get from point in time forwards.
value from NotificationList.cacheable_cursor.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- rpc_func2 (client, id_str, payload_str, http_key_str, callback, retry_policy, cancellation_token)
-
rpc_func2
Execute a Lua function on the server.
Parameters:
- client Client.
- id_str () The identifier of the function.
- payload_str () The payload of the function which must be a JSON object.
- http_key_str () The authentication key used when executed as a non-client HTTP request.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- rpc_func (client, id_str, payload, http_key_str, callback, retry_policy, cancellation_token)
-
rpc_func
Execute a Lua function on the server.
Parameters:
- client Client.
- id_str () The identifier of the function.
- payload (string) The payload of the function which must be a JSON object.
- http_key_str () The authentication key used when executed as a non-client HTTP request.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_storage_objects (client, collection_str, user_id_str, limit_int, cursor_str, callback, retry_policy, cancellation_token)
-
list_storage_objects
List publicly readable storage objects in a given collection.
Parameters:
- client Client.
- collection_str () The collection which stores the object.
- user_id_str () ID of the user.
- limit_int () The number of storage objects to list. Between 1 and 100.
- cursor_str
() The cursor to page through results from.
value from StorageObjectList.cursor.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_storage_objects2 (client, collection_str, user_id_str, limit_int, cursor_str, callback, retry_policy, cancellation_token)
-
list_storage_objects2
List publicly readable storage objects in a given collection.
Parameters:
- client Client.
- collection_str () The collection which stores the object.
- user_id_str () ID of the user.
- limit_int () The number of storage objects to list. Between 1 and 100.
- cursor_str
() The cursor to page through results from.
value from StorageObjectList.cursor.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_tournaments (client, category_start_int, category_end_int, start_time_int, end_time_int, limit_int, cursor_str, callback, retry_policy, cancellation_token)
-
list_tournaments
List current or upcoming tournaments.
Parameters:
- client Client.
- category_start_int () The start of the categories to include. Defaults to 0.
- category_end_int () The end of the categories to include. Defaults to 128.
- start_time_int () The start time for tournaments. Defaults to epoch.
- end_time_int () The end time for tournaments. Defaults to +1 year from current Unix time.
- limit_int () Max number of records to return. Between 1 and 100.
- cursor_str () A next page cursor for listings (optional).
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- delete_tournament_record (client, tournament_id_str, callback, retry_policy, cancellation_token)
-
delete_tournament_record
Delete a tournament record.
Parameters:
- client Client.
- tournament_id_str () The tournament ID to delete from.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_tournament_records (client, tournament_id_str, owner_ids_arr, limit_int, cursor_str, expiry_str, callback, retry_policy, cancellation_token)
-
list_tournament_records
List tournament records.
Parameters:
- client Client.
- tournament_id_str () The ID of the tournament to list for.
- owner_ids_arr () One or more owners to retrieve records for.
- limit_int () Max number of records to return. Between 1 and 100.
- cursor_str () A next or previous page cursor.
- expiry_str () Expiry in seconds (since epoch) to begin fetching records from.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- join_tournament (client, tournament_id_str, callback, retry_policy, cancellation_token)
-
join_tournament
Attempt to join an open and running tournament.
Parameters:
- client Client.
- tournament_id_str () The ID of the tournament to join. The tournament must already exist.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_tournament_records_around_owner (client, tournament_id_str, owner_id_str, limit_int, expiry_str, cursor_str, callback, retry_policy, cancellation_token)
-
list_tournament_records_around_owner
List tournament records for a given owner.
Parameters:
- client Client.
- tournament_id_str () The ID of the tournament to list for.
- owner_id_str () The owner to retrieve records around.
- limit_int () Max number of records to return. Between 1 and 100.
- expiry_str () Expiry in seconds (since epoch) to begin fetching records from.
- cursor_str () A next or previous page cursor.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- get_users (client, ids_arr, usernames_arr, facebook_ids_arr, callback, retry_policy, cancellation_token)
-
get_users
Fetch zero or more users by ID and/or username.
Parameters:
- client Client.
- ids_arr () The account id of a user.
- usernames_arr () The account username of a user.
- facebook_ids_arr () The Facebook ID of a user.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- list_user_groups (client, user_id_str, limit_int, state_int, cursor_str, callback, retry_policy, cancellation_token)
-
list_user_groups
List groups the current user belongs to.
Parameters:
- client Client.
- user_id_str () ID of the user.
- limit_int () Max number of records to return. Between 1 and 100.
- state_int () The user group state to list.
- cursor_str () An optional next page cursor.
- callback (function) Optional callback function A coroutine is used and the result is returned if no callback function is provided.
- retry_policy (function) Optional retry policy used specifically for this call or nil
- cancellation_token (table) Optional cancellation token for this call
Returns:
-
The result.
- create_client (config)
-
Create a Nakama client instance.
Parameters:
- config A table of configuration options. config.engine - Engine specific implementations. config.host config.port config.timeout config.use_ssl - Use secure or non-secure sockets. config.bearer_token config.username config.password
Returns:
-
Nakama Client instance.
- create_socket (client)
-
Create a Nakama socket.
Parameters:
- client The client to create the socket for.
Returns:
-
Socket instance.
- set_bearer_token (client, bearer_token)
-
Set Nakama client bearer token.
Parameters:
- client Nakama client.
- bearer_token Authorization bearer token.
Fields
- APIOPERATOR_NO_OVERRIDE
-
api_operator
Operator that can be used to override the one set in the leaderboard.
- NO_OVERRIDE: Do not override the leaderboard operator. - BEST: Override the leaderboard operator with BEST. - SET: Override the leaderboard operator with SET. - INCREMENT: Override the leaderboard operator with INCREMENT. - DECREMENT: Override the leaderboard operator with DECREMENT.
- APISTOREENVIRONMENT_UNKNOWN
- api_store_environment - UNKNOWN: Unknown environment. - SANDBOX: Sandbox/test environment. - PRODUCTION: Production environment.
- APISTOREPROVIDER_APPLE_APP_STORE
- api_store_provider - APPLE_APP_STORE: Apple App Store - GOOGLE_PLAY_STORE: Google Play Store - HUAWEI_APP_GALLERY: Huawei App Gallery - FACEBOOK_INSTANT_STORE: Facebook Instant Store
- client
-
update_account
Update fields in the current user's account.
- client Client.
- avatarUrl (string) A URL for an avatar image.
- displayName (string) The display name of the user.
- langTag (string) The language expected to be a tag which follows the BCP-47 spec.
- location (string) The location set by the user.
- timezone (string) The timezone set by the user.
- username (string) The username of the user's account.
- client
-
authenticate_apple
Authenticate a user with an Apple ID against the server.
- client Client.
- token (string) The ID token received from Apple to validate.
- vars (object) Extra information that will be bundled in the session token.
- client
-
authenticate_custom
Authenticate a user with a custom id against the server.
- client Client.
- id (string) A custom identifier.
- vars (object) Extra information that will be bundled in the session token.
- client
-
authenticate_device
Authenticate a user with a device id against the server.
- client Client.
- id (string) A device identifier. Should be obtained by a platform-specific device API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
authenticate_email
Authenticate a user with an email+password against the server.
- client Client.
- email (string) A valid RFC-5322 email address.
- password
(string) A password for the user account.
Ignored with unlink operations.
- vars (object) Extra information that will be bundled in the session token.
- client
-
authenticate_facebook
Authenticate a user with a Facebook OAuth token against the server.
- client Client.
- token (string) The OAuth token received from Facebook to access their profile API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
authenticate_facebook_instant_game
Authenticate a user with a Facebook Instant Game token against the server.
- client Client.
- signedPlayerInfo (string)
- vars (object) Extra information that will be bundled in the session token.
- client
-
authenticate_game_center
Authenticate a user with Apple's GameCenter against the server.
- client Client.
- bundleId (string) Bundle ID (generated by GameCenter).
- playerId (string) Player ID (generated by GameCenter).
- publicKeyUrl (string) The URL for the public encryption key.
- salt (string) A random "NSString" used to compute the hash and keep it randomized.
- signature (string) The verification signature data generated.
- timestampSeconds (string) Time since UNIX epoch when the signature was created.
- vars (object) Extra information that will be bundled in the session token.
- client
-
authenticate_google
Authenticate a user with Google against the server.
- client Client.
- token (string) The OAuth token received from Google to access their profile API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
authenticate_steam
Authenticate a user with Steam against the server.
- client Client.
- token (string) The account token received from Steam to access their profile API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
link_apple
Add an Apple ID to the social profiles on the current user's account.
- client Client.
- token (string) The ID token received from Apple to validate.
- vars (object) Extra information that will be bundled in the session token.
- client
-
link_custom
Add a custom ID to the social profiles on the current user's account.
- client Client.
- id (string) A custom identifier.
- vars (object) Extra information that will be bundled in the session token.
- client
-
link_device
Add a device ID to the social profiles on the current user's account.
- client Client.
- id (string) A device identifier. Should be obtained by a platform-specific device API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
link_email
Add an email+password to the social profiles on the current user's account.
- client Client.
- email (string) A valid RFC-5322 email address.
- password
(string) A password for the user account.
Ignored with unlink operations.
- vars (object) Extra information that will be bundled in the session token.
- client
-
link_facebook
Add Facebook to the social profiles on the current user's account.
- client Client.
- token (string) The OAuth token received from Facebook to access their profile API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
link_facebook_instant_game
Add Facebook Instant Game to the social profiles on the current user's account.
- client Client.
- signedPlayerInfo (string)
- vars (object) Extra information that will be bundled in the session token.
- client
-
link_game_center
Add Apple's GameCenter to the social profiles on the current user's account.
- client Client.
- bundleId (string) Bundle ID (generated by GameCenter).
- playerId (string) Player ID (generated by GameCenter).
- publicKeyUrl (string) The URL for the public encryption key.
- salt (string) A random "NSString" used to compute the hash and keep it randomized.
- signature (string) The verification signature data generated.
- timestampSeconds (string) Time since UNIX epoch when the signature was created.
- vars (object) Extra information that will be bundled in the session token.
- client
-
link_google
Add Google to the social profiles on the current user's account.
- client Client.
- token (string) The OAuth token received from Google to access their profile API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
link_steam
Add Steam to the social profiles on the current user's account.
- client Client.
- account () The Facebook account details.
- sync (boolean) Import Steam friends for the user.
- client
-
session_refresh
Refresh a user's session using a refresh token retrieved from a previous authentication request.
- client Client.
- token (string) Refresh token.
- vars (object) Extra information that will be bundled in the session token.
- client
-
unlink_apple
Remove the Apple ID from the social profiles on the current user's account.
- client Client.
- token (string) The ID token received from Apple to validate.
- vars (object) Extra information that will be bundled in the session token.
- client
-
unlink_custom
Remove the custom ID from the social profiles on the current user's account.
- client Client.
- id (string) A custom identifier.
- vars (object) Extra information that will be bundled in the session token.
- client
-
unlink_device
Remove the device ID from the social profiles on the current user's account.
- client Client.
- id (string) A device identifier. Should be obtained by a platform-specific device API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
unlink_email
Remove the email+password from the social profiles on the current user's account.
- client Client.
- email (string) A valid RFC-5322 email address.
- password
(string) A password for the user account.
Ignored with unlink operations.
- vars (object) Extra information that will be bundled in the session token.
- client
-
unlink_facebook
Remove Facebook from the social profiles on the current user's account.
- client Client.
- token (string) The OAuth token received from Facebook to access their profile API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
unlink_facebook_instant_game
Remove Facebook Instant Game profile from the social profiles on the current user's account.
- client Client.
- signedPlayerInfo (string)
- vars (object) Extra information that will be bundled in the session token.
- client
-
unlink_game_center
Remove Apple's GameCenter from the social profiles on the current user's account.
- client Client.
- bundleId (string) Bundle ID (generated by GameCenter).
- playerId (string) Player ID (generated by GameCenter).
- publicKeyUrl (string) The URL for the public encryption key.
- salt (string) A random "NSString" used to compute the hash and keep it randomized.
- signature (string) The verification signature data generated.
- timestampSeconds (string) Time since UNIX epoch when the signature was created.
- vars (object) Extra information that will be bundled in the session token.
- client
-
unlink_google
Remove Google from the social profiles on the current user's account.
- client Client.
- token (string) The OAuth token received from Google to access their profile API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
unlink_steam
Remove Steam from the social profiles on the current user's account.
- client Client.
- token (string) The account token received from Steam to access their profile API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
event
Submit an event for processing in the server's registered runtime custom events handler.
- client Client.
- external (boolean) True if the event came directly from a client call, false otherwise.
- name (string) An event name, type, category, or identifier.
- properties (object) Arbitrary event property values.
- timestamp (string) The time when the event was triggered.
- client
-
import_facebook_friends
Import Facebook friends and add them to a user's account.
- client Client.
- token (string) The OAuth token received from Facebook to access their profile API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
import_steam_friends
Import Steam friends and add them to a user's account.
- client Client.
- token (string) The account token received from Steam to access their profile API.
- vars (object) Extra information that will be bundled in the session token.
- client
-
create_group
Create a new group with the current user as the owner.
- client Client.
- avatarUrl (string) A URL for an avatar image.
- description (string) A description for the group.
- langTag (string) The language expected to be a tag which follows the BCP-47 spec.
- maxCount (integer) Maximum number of group members.
- name (string) A unique name for the group.
- open (boolean) Mark a group as open or not where only admins can accept members.
- client
-
validate_purchase_apple
Validate Apple IAP Receipt
- client Client.
- persist (boolean)
- receipt (string) Base64 encoded Apple receipt data payload.
- client
-
validate_purchase_facebook_instant
Validate FB Instant IAP Receipt
- client Client.
- persist (boolean)
- signedRequest (string) Base64 encoded Facebook Instant signedRequest receipt data payload.
- client
-
validate_purchase_google
Validate Google IAP Receipt
- client Client.
- persist (boolean)
- purchase (string) JSON encoded Google purchase payload.
- client
-
validate_purchase_huawei
Validate Huawei IAP Receipt
- client Client.
- persist (boolean)
- purchase (string) JSON encoded Huawei InAppPurchaseData.
- signature (string) InAppPurchaseData signature.
- client
-
list_subscriptions
List user's subscriptions.
- client Client.
- cursor (string)
- limit (integer)
- client
-
validate_subscription_apple
Validate Apple Subscription Receipt
- client Client.
- persist (boolean) Persist the subscription.
- receipt (string) Base64 encoded Apple receipt data payload.
- client
-
validate_subscription_google
Validate Google Subscription Receipt
- client Client.
- persist (boolean) Persist the subscription.
- receipt (string) JSON encoded Google purchase payload.
- client
-
write_leaderboard_record
Write a record to a leaderboard.
- client Client.
- leaderboard_id_str () The ID of the leaderboard to write to.
- metadata (string) Optional record metadata.
- operator () Operator override.
- score (string) The score value to submit.
- subscore (string) An optional secondary value.
- client
-
session_logout
Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user.
- client Client.
- refreshToken (string) Refresh token to invalidate.
- token (string) Session token to log out.
- client
-
read_storage_objects
Get storage objects.
- client Client.
- objectIds (array) Batch of storage objects.
- client
-
write_storage_objects
Write objects into the storage engine.
- client Client.
- objects (array) The objects to store on the server.
- client
-
delete_storage_objects
Delete one or more objects by ID or username.
- client Client.
- objectIds (array) Batch of storage objects.
- client
-
write_tournament_record2
Write a record to a tournament.
- client Client.
- tournament_id_str () The tournament ID to write the record for.
- metadata (string) A JSON object of additional properties (optional).
- operator () Operator override.
- score (string) The score value to submit.
- subscore (string) An optional secondary value.
- client
-
write_tournament_record
Write a record to a tournament.
- client Client.
- tournament_id_str () The tournament ID to write the record for.
- metadata (string) A JSON object of additional properties (optional).
- operator () Operator override.
- score (string) The score value to submit.
- subscore (string) An optional secondary value.