This getting started guide shows you how to integrate Zendesk Messaging into your Unity application.

Prerequisites

1. Add the SDK dependency

Adding a scoped registry

In the Unity Editor, click Project Settings > Package Manager and expand the Scoped Registries group.

Enter the following registry details and click Save.

Name: ZendeskURL: https://zendesk.jfrog.io/artifactory/api/npm/unity-sdkScopes: com.zendesk.messaging

Installing the Zendesk SDK for Unity package

In the Unity Editor, open the Package Manager by selecting Window > Package Manager. Browse or search for Zendesk SDK for Unity package, select it from the list, and then click Install. For more information, see the Package Manager window documentation.

Installing Sample scenes

To install samples, select Import next to the desired sample in the package details tab.

Dependencies

Please consult the list of dependencies used in our SDK.

2. Get your channel key

See How to get a channel key in Zendesk help.

3. Initialize the SDK

  1. Add the following import to your project:

    C#

    using Zendesk.Runtime.SDK;
  2. Call await ZendeskSdk.InitializeAsync(config => config.ChannelId = "channelId");.

    Optional parameters:

    • Language: Language of the SDK of type "ZendeskLanguage". If not set, it defaults to the device language.
    • MetadataValidationEnabled (Added after 3.2.0) : Controls whether metadata (tags and fields) are validated before being sent. If true, client-side validation of metadata is enforced. Defaults to false.

    C#

    await ZendeskSdk.InitializeAsync(config =>{    config.ChannelId = "channelId";    config.Language = ZendeskLanguage.English;    config.MetadataValidationEnabled = true;});

4. Show messaging

You can display the messaging interface anywhere in your application using the following code:

  1. Call the ShowMessagingAsync() method from the ZendeskSdk.Instance.Messaging instance.

    Optional parameters:

    • parentTransform: Parent transform that the Zendesk prefab will be child of, or null (the Zendesk prefab is spawned at the root of the scene hierarchy).

    C#

    await ZendeskSdk.Instance.Messaging.ShowMessagingAsync();

After ShowMessagingAsync() is called, the Zendesk Messaging UI is displayed with the most recent conversation or the conversation list (if multi-conversations is enabled - available in SDK 3.4.0 and above).

5. Show the home screen

Alternatively, you can display the home interface anywhere in your application using the following code:

See the prerequisites before showing the home screen with help center.

To show the home screen with help center, call the ShowHomeAsync(); method from the ZendeskSdk.Instance.Home instance.

Optional parameters:

  • parentTransform: Parent transform that the Zendesk prefab will be child of, or null (the Zendesk prefab is spawned at the root of the scene hierarchy).

C#

await ZendeskSdk.Instance.Home.ShowHomeAsync();

After ShowHomeAsync() is called, the Zendesk Home UI appears.

SDK size

The size of the Zendesk SDK for Unity after installation will vary depending on your target and build settings. As a general guideline:

  • Package download size: Approximately 20 MB (may vary by version)
  • App size impact: The final impact on your app’s size may be smaller after minification and resource compression.
  • Dependency impact: Additional dependencies may increase the total size.

Next steps