Code examples

Avatar Creator integration

Integrate the Avatar Creator in your game or app as an iframe or WebView.If you followed the Quickstart you already integrated the Avatar Creator into a website using an iframe. This guide details the integration and customization options of this Avatar Creator.

Subscribe to Events

The iframe exposes a post message API that can be used to subscribe to events and for triggering certain actions. The example code from the Quickstart shows how to set up the subscription handler and how to trigger custom code on different events.To enable the events you need to append the parameter ?frameApi to the avatar-creator URL.https://demo.enoch.app/avatar?frameApi

Emitted Events

All messages that the iframe emits will always contain a eventName and source and can be used for filtering the output that is emitted. See the table below for all the currently supported events and their sample outputs.

Queries

Supported messages that can be posted to the iframe after the v1.frame.enoch event has been emitted.

Avatar Creator Configuration

While you can configure most of the Avatar Creator features from Studio, for some use cases it might be helpful to do it by providing a query string to the URL. The available parameters, values, and their effects are described in the following table.

Last updated