Try Me!

Request a 2D full-body avatar image and display it in a web page.
The JavaScript code below sends a request to a server for a slightly smiling 2D full-body avatar and displays the image in a web page.
  1. 1.
    Save the code below as a .html file.
  2. 2.
    Open the file in your browser.
  3. 3.
    Click the Render button to send the request.
  4. 4.
    Wait for the response, which can take several seconds.
  5. 5.
    Verify and dismiss the alert.
  6. 6.
    The image should display.

Javascript code

<!doctype html>
<meta charset="UTF-8"/>
<!-- Click this button to send the request. -->
<button onclick="return render()">Render</button>
function render()
const params =
// Replace with the .glb URL for the desired avatar.
model: "",
// Type of portrait to render.
scene: "fullbody-portrait-v1",
// Optional: Pose. Default: T-pose.
armature: "ArmatureTargetMale",
// Optional: Facial expression. Default: Empty.
"blendShapes": {"Wolf3D_Avatar": {"mouthSmile": 0.2 }}
const http = new XMLHttpRequest()"POST", "")
http.setRequestHeader("Content-type", "application/json")
http.onload = function()
// Show the response
// Parse the response and display the image
var image = JSON.parse(http.responseText)["renders"]
var outputImg = document.createElement('img')
outputImg.src = image