Enoch
  • The Vision
    • 🎯Our Mission
    • 🕵️‍♂️Who we are
    • 🎇What problem are we Tackling?
  • Enoch Introduction
    • 🎯Intro to Enoch
    • 🚀Stargate App
    • 🛒3D Marketplace App
  • Roadmap
    • 🗓️Roadmap
  • Enoch platform
    • 🏫Product categories
  • Create
    • 🏤Posts
    • 🫂Community
    • 🌆Event
    • 🧘‍♀️NFT
    • 🌐Sphere
    • 🤾‍♂️Reel
    • 🎶Professional Page
    • 🔈Groups
    • 🎟️Job
    • 🌤️Ad
  • PERSONAL
    • 💸Monetization
    • 💰Wallet
    • 💳Giftcard
    • 📅Calendar
    • 🧚‍♂️Ranking
    • ⭐Badges
    • 🎟️Daily Missions
    • 💰Pricing
    • 🧾Billing
    • 🤝Affiliate
  • Social
    • 📲Home Feed
    • 👨‍🎓User Profile
    • ▶️Media Content
    • ⚡Messenger
    • 🧑‍🤝‍🧑My Network
    • 🧘‍♀️Community
    • 🎶Events
    • 🎟️Live-Zone
    • 🔈Sphere
    • 📃Professional Pages
    • 🌤️News Feed
  • Creative
    • ⛩️Introduction
    • 👩‍🎨Creator Portals
    • 🎙️fantasy Studio
      • My Avatars
      • Meridian
      • Magic Tools
        • Journal
        • Inventory
        • Shop
        • Avatar
      • Gallery
    • 🎹Enoch Studio
  • Shopping
    • 📊Enoch 3D Marketplace
    • 🛍️Seller's Shops
  • Find Work
    • 💼Jobs
  • Developers (Integration Guide)
    • 👾Overview
    • 🐟Fish Hub
    • 🤖Avatar Creator Setup
      • Avatar URLs
      • Avatar codes
    • 🔵Unity Integration
      • Quick start
      • Load Avatars
      • Avatar Creator Integration
        • Android and iOS
        • VR and PC
        • WebGL
      • Optimize
        • Avatar Configuration
        • Avatar Caching
      • Code examples
        • Loading 3D Avatars
        • Loading 2D Avatars
        • Avatar Creator ( WebGL)
        • Avatar Creator (Desktop)
        • Avatar Creator (Mobile)
        • Distance-based LODs
      • Troubleshooting
        • Avatar loading issue
        • iOS issues
        • WebGL issues
        • Firewall issues
      • Help us improve the Unity SDK
      • FAQs for Unity
    • ⚡Unreal Engine Integration
      • Quick start
      • Load Avatars
      • Avatar Creator Integration
        • Android and iOS
        • VR and PC
        • WebGL
      • Optimize
        • Avatar Configuration
        • Avatar Caching
      • Code examples
        • Loading 3D Avatars
        • Loading 2D Avatars
        • Avatar Creator ( WebGL)
        • Avatar Creator (Desktop)
        • Avatar Creator (Mobile)
        • Distance-based LODs
      • Troubleshooting
        • Avatar loading issue
        • iOS issues
        • WebGL issues
        • Firewall issues
      • Help us improve the Unity SDK
      • FAQs for Unity
    • 🕸️Web & native Integration
      • Quick start
      • Code examples
      • Common errors
  • Enoch Advertising
    • 🎟️Ad Manager
    • ⭐Enoch Ad
  • Settings
    • 🔒Your Private Profile
    • ⚙️Your Account
  • Open Finance
    • 📖Dashboard
    • 📈Trade
      • Paradigm Swap
      • Paradigm Liquidity Pool
      • Paradigm Bridge
    • 🔮Financial Pools
      • Ranking Pools
      • Daily Missions Pools
      • Cerberus Pools
      • Trinity Pools
      • Prometheus Pools
      • Lazarus Pools
  • Enochian Party Program
    • 🤸Intro to Enochian Party Pass
    • 🛫Party beginner’s guide
    • 🏄Enochian Season
    • 🎉Party Pass Guide
    • 🍺Party Pass Benefits
    • 📶Party FIND ANSWERS
    • 🤺Ninja Warrior 3D Collectectibles
    • 🏃Ark Of Convenent
  • Yokai Air Drop
    • 🤸Intro to Yokia Air drop
    • 🏄Meet the yokai mythical creatures
    • 🛫Yokai beginner’s guide
    • 🎉Yokai Air drop Guide
    • 📶Yokai Find Answer
    • ✖️Yokai Mutation
  • TECHNOLOGY
    • 🦸‍♂️Web 2.0 Protocols
    • 🦸‍♂️Web 3.0 Protocols
      • Metatron
      • Uriel
      • ZK Rollups
    • 🏗️Web 3.0 Smart Contracts
      • Dual Token
      • Stargate
      • 3D MarketPlace
      • Financial Pool
      • Yokia AirDrop
      • Enochian Party Pass
    • 🤖Atlantis A.I engine
      • Feature
        • Text-to-Speech
        • Evie-Chat-Assistant
        • Video-Animation
        • Text-To-3D
        • Text-to-Image
        • Text-to-Video
        • Text-To-Music
        • Torus
        • 2d to 3D
      • Evie Chat Assistance
    • ☁️Cloud Infrastructure
  • API references
    • ⛓️Enoch Rest APIs
      • Access and Authentication
      • Response codes & types
      • GET - 3D Avatars
      • GET - 2D Avatars
      • GET - Metadata
      • Changelog
    • 🔵Unity SDK
      • AvatarCache
      • AvatarConfig
      • AvatarObjectLoader
      • AvatarRenderLoader
      • WebView
      • SDKLogger
      • Changelog
    • ⚡Unreal Engine SDK
      • AvatarObjectLoader
      • AvatarRenderLoader
      • Actor
      • Component
      • MemoryCache
      • Setting
      • BlueprintLibrary
      • FunctionLibrary
      • AvatarConfig
      • Changelog
  • Investment
    • 📈Metanomics
    • 🪙Dual Token Model
    • 💲Enoch Yield Farming
    • 💸$ENOCH Investor benefits
    • ❔FAQ
  • Enoch Ecosystem & Functions
    • 🧪Enoch Labs
    • 💹How to earn income in Enoch
    • 👽Social Fi
      • Ranking Pools
      • Daily Missions
    • 💸Social Monetization
      • Live Gifting
      • Uriel Gifting
      • Premium Content
      • Seller Shop
      • Ranking
      • Daily Mission Prizes
      • Drops
  • Payment Gateway
    • 🏬Payment Gateway
  • Team
    • ⭐Teams
  • ENOCH TUTORIALS
    • 👥Social
      • Profile Setup
    • 🛍️Shopping
      • Setting up your Shop
    • 🎗️Creative
      • 👘Becoming a 3D artist
    • 💎Open Finance
      • Staking Pools
      • DEX
      • Love and Enoch
  • KNOW US MORE
    • ⛑️Support and Safety
Powered by GitBook
On this page
  1. Developers (Integration Guide)
  2. Web & native Integration

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.

v1.frame.enoch

{eventName: 'v1.frame.enoch',

source: 'enoch'}

v1.subscription.created

{correlationId,data: { eventName },eventName: 'v1.subscription.created',source: 'enoch',statusCode: 201}

v1.subscription.deleted

{correlationId,data: { eventName },eventName: 'v1.subscription.deleted',source: 'enoch',statusCode: 200}

v1.avatar.exported

{data: {url,userId},eventName: 'v1.avatar.exported',source: 'enoch',}

v1.user.set

{data: { id },eventName: 'v1.user.set',source: 'enoch',}

v1.user.updated

{data: { id },eventName: 'v1.user.updated',source: 'enoch',}

v1.user.logout

{correlationId,eventName: 'v1.user.logout'source: 'enoch'statusCode: 200type: 'queryResponse'}

Queries

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

Effect

Message example

Logout user

iframe.contentWindow.postMessage(JSON.stringify({target: 'enoch',type: 'query',eventName: 'v1.user.logout'}),'*');

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.

Parameter

Value

Effect

frameApi

​

clearCache

​

Disables caching avatar customization and restarts the app upon refreshing the iframe or when creating a new instance.

selectBodyType

​

Enables selecting between halfbody and fullbody avatars.

bodyType

'halfbody' | 'fullbody'

Selects a body type for the avatar in the editor or allows the user to choose from both. Please note, that this only influences the behavior of the avatar-creator, but not the avatar-type you get on requesting an avatar. If you want to change that too, please contact

PreviousQuick startNextCommon errors

Last updated 2 years ago

Enables subscribing to postMessage events provided by the iframe. See more about below.

🕸️
messaging