defold/extension-zendesk/zendesk
Defold native extension to interact with the Zendesk SDK.
- GitHub: defold/extension-zendesk — pinned to
1.0.1(released while Defold 1.13.1 was current)- Pick a release from defold/extension-zendesk releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as zendesk from "zendesk"
- Pick a release from defold/extension-zendesk releases and add its Source code (zip) URL (or a packaged
Functions
zendesk.initialize(channel: string)zendesk.set_callback(callback: function)zendesk.show_messaging()zendesk.set_conversation_fields(fields: table)zendesk.clear_conversation_fields()zendesk.set_conversation_tags(tags: table)zendesk.clear_conversation_tags()zendesk.login(jwt: string)zendesk.logout()
zendesk.initialize(channel: string)
Initialize the Zendesk SDK
Parameters
channel:string— Zendesk channel to initialize SDK with
zendesk.set_callback(callback: function)
Set a callback for events from the Zendesk SDK
Parameters
callback:function— Function to call when a Zendesk SDK event is received (self, event, data)
zendesk.show_messaging()
Show the conversation screen.
zendesk.set_conversation_fields(fields: table)
Set conversation fields in the SDK to add contextual data about the conversation.
Parameters
fields:table— Key value pairs of fields. Keys must be strings. Values can be strings, numbers and booleans.
zendesk.clear_conversation_fields()
Clear conversation fields from the SDK storage when the client side context changes.
zendesk.set_conversation_tags(tags: table)
Set custom conversation tags in the SDK to add contextual data about the conversation.
Parameters
tags:table— Array of string
zendesk.clear_conversation_tags()
Clear conversation tags from SDK storage when the client side context changes.
zendesk.login(jwt: string)
Authenticate a user.
Parameters
jwt:string— JSON Web Token for authentication
zendesk.logout()
Unauthenticate a user.
Constants
zendesk.MSG_INIT_ERROR
An error was detected while initializing the Zendesk SDK
zendesk.MSG_INIT_SUCCESS
The Zendesk SDK has been initialized successfully
zendesk.MSG_INTERNAL_ERROR
An internal error occured
zendesk.MSG_ERROR
An generic error occured
zendesk.MSG_UNREAD_MESSAGE_COUNT_CHANGED
The number of unread messages has changed
zendesk.MSG_AUTHENTICATION_FAILED
A REST call failed for authentication reasons
zendesk.MSG_FIELD_VALIDATION_FAILED
Validation checks failed for conversation fields
zendesk.MSG_LOGIN_SUCCESS
Login was successful
zendesk.MSG_LOGIN_FAILED
Login failed
zendesk.MSG_LOGOUT_SUCCESS
Logout was successful
zendesk.MSG_LOGOUT_FAILED
Logout failed