LogoLogo
  • ๐Ÿ“˜Knowledge Center
  • Before Getting Started
    • ๐Ÿ”ท3D User
    • ๐Ÿ”ทAI User
    • ๐Ÿ”ทMerchandiser
    • ๐Ÿ”ทWeb Developer
  • CREATOR INTERFACE
    • ๐Ÿ”ทCreator Home Page
    • ๐Ÿ”ทCanvas / Workspace
    • ๐Ÿ”ทExport
  • Creator
    • ๐Ÿ”ทGetting Started
      • ๐Ÿ”นSign Up
        • ๐Ÿ”นHow to Sign up Using Gmail?
        • ๐Ÿ”นHow to Sign up Using Apple Id?
        • ๐Ÿ”นHow to Sign up Using Email?
    • ๐Ÿ”ทCreator Navigation
    • ๐Ÿ”ทProjects
      • ๐Ÿ”ทHow to use the Quick Access Tools?
      • ๐Ÿ”ทView Port Settings
      • ๐Ÿ”ทGenerate AI 3D Models
      • ๐Ÿ”ทObject
        • ๐Ÿ”ทUpload Object
        • ๐Ÿ”นTransform
        • ๐Ÿ”ทNode Hierarchy
        • ๐Ÿ”ทMaterial Change
      • ๐Ÿ”ทScene
      • ๐Ÿ”ทImage
      • ๐Ÿ”ทVideo
      • ๐Ÿ”ทAudio
      • ๐Ÿ”ทHDRI
      • ๐Ÿ”นLight
      • ๐Ÿ”ทText
      • ๐Ÿ”ทCamera
      • ๐Ÿ”ทAnimation Timeline
      • ๐Ÿ”ทExport
      • ๐Ÿ”ท3D/AR
    • ๐Ÿ”ทAssets
    • ๐Ÿ”ทCommunity Showcase
    • ๐Ÿ”ทUpload Your Catalog
      • ๐Ÿ”ทDownload Template
      • ๐Ÿ”ทUpload File
      • ๐Ÿ”ทUpload 3D Model
        • ๐Ÿ”ทProduct Information
        • ๐Ÿ”ทAdditional Details
          • ๐Ÿ”นColor Variant
          • ๐Ÿ”นInteraction
          • ๐Ÿ”นDimensions
        • ๐Ÿ”ทProceed to Preview
        • ๐Ÿ”ทSupported Files Formats
    • ๐Ÿ”ทUser Management
    • ๐Ÿ”ทMy Profile
      • ๐Ÿ”นHow to Seek Help?
      • ๐Ÿ”นAbout
      • ๐Ÿ”นHow to Logout from Creator?
    • ๐Ÿ”ทGuidelines For 3D Model Creation
  • IDE - Low Code
    • ๐Ÿ”ทGetting Started
    • ๐Ÿ”ทIDE Functions
      • ๐Ÿ”นAdd Object to The Scene
      • ๐Ÿ”นAdd Light to the Scene
      • ๐Ÿ”นAdd Environment to the Scene
      • ๐Ÿ”นAdd Background to the Scene
      • ๐Ÿ”นAdd Room to the Scene
      • ๐Ÿ”นAdd Text to the Scene
      • ๐Ÿ”นAdd Image to the Scene
      • ๐Ÿ”นShow/Hide Object
      • ๐Ÿ”นShow/Hide Image
      • ๐Ÿ”นAdd Scroll Break Points
      • ๐Ÿ”นAdd Animation to the Scene
      • ๐Ÿ”นAdd Model Transformation to the Scene
      • ๐Ÿ”นAdd Animation Block to the Scene
      • ๐Ÿ”นPlay GLB Animation (pre built in GLB file)
    • ๐Ÿ”ทExamples and Tutorials:
  • Developer Documentation
    • ๐Ÿ› ๏ธHow to Integrate Avataar Experiences?
      • ๐Ÿ› ๏ธIntegration with Web Renderer (React Package)
      • ๐Ÿ› ๏ธIntegration with Web Renderer (Javascript Package)
      • ๐Ÿ› ๏ธIntegration with Android Renderer
      • ๐Ÿ› ๏ธIntegration with iOS Renderer
      • ๐Ÿ› ๏ธIntegration of Experiences via Creator (React Package)
      • ๐Ÿ› ๏ธIntegration of Experiences via Creator (Javascript Package)
  • Incarnate
    • ๐Ÿ”ทGetting Started
      • ๐Ÿ”ทDevice Eligibility & Settings
      • ๐Ÿ”ทHow to Download 'Incarnate by Avataar'?
      • ๐Ÿ”ทSign Up
        • ๐Ÿ”นHow to Sign Up Using Google?
        • ๐Ÿ”นHow to Sign Up Using Apple ID?
        • ๐Ÿ”นHow to Sign Up Using Email?
      • ๐Ÿ”ทHow to Setup The Ideal Environment for Capture?
    • ๐Ÿ”ทA Guided Tour Through the App
      • ๐Ÿ”ทHow to Choose an Object to Scan?
      • ๐Ÿ”ทHow to Use the Hamburger Menu Button?
      • ๐Ÿ”ทHow to Use the Floor Detection Feature?
      • ๐Ÿ”ทBounding Box
        • ๐Ÿ”นHow to Resize the Bounding Box?
        • ๐Ÿ”นHow to Adjust the Bounding Box?
      • ๐Ÿ”ทHow to Capture the Object?
      • ๐Ÿ”ทHow to Upload the Captured Object?
      • ๐Ÿ”ทHow to Ensure a Good Capture?
  • Release Notes
    • Version 2.4
    • Version 2.3
    • Version 2.2
    • Version 2.1
    • Version 2.0
    • December 1, 2023
Powered by GitBook
On this page
  1. Developer Documentation
  2. How to Integrate Avataar Experiences?

Integration of Experiences via Creator (Javascript Package)

Integration Steps:

Please follow the below steps to integrate the Creator Javascript Package on your website

  1. Create an html element with a specific id attribute.

Example :

 <div id="creator-exp"></div>
  1. Once the element is created, add the following script to your webpage to import the javascript package provided by Avataar.

<script src="https://web2.avataar.me/creator-js/creator-0.1.46.js"></script>
  1. Post importing the package, add the following code snippet to your script tag providing the details (config URL and auth token)of any particular SKU you want to render. Your CMS will share the process to get the config URL.

creator.render({
elementId: <HTML-ELEMENT-ID>,
configLink:<CONFIG-URL>,
token: <TOKEN>,
env: โ€œproductionโ€,
onScrollProgress: <CALLBACK-FUNCTION-ON-EXP-SCROLL>
});

References :

HTML-ELEMENT-ID -> Where do you want to render experience CONFIG-URL -> your experience config url

TOKEN -> your token

Env -> Production

onScrollProgress -> a callback function that returns how much the scroll experience has been evolved.

Sample :

Use the config URL and token from the below example for testing:

<!DOCTYPE html>
<html lang="en">


  <head>
    <style>
      #alhena-exp {
        width: 100vw;
        height: 100vh;
      }
    </style>
  </head>
  <body>
    <div id="creator-exp"></div>
    <script src="https://web2.avataar.me/creator-js/creator-0.1.46.js"></script>
    <script>
      creator.render({
        elementId: "creator-exp",
        configLink: <Config.json>,
        token: <token provided by Avataar team>,
        env: โ€œproductionโ€,
        onScrollProgress: onScrollProgress,
     });


     function onScrollProgress(value) {
        console.log(onScrollProgress", value);
        scrollObserver(value);
      }


      function scrollObserver(progress) {
        const observer = new IntersectionObserver((entries, observer) => {
          entries.forEach((entry) => {
            if (entry.isIntersecting && entry.intersectionRatio >= 0.8) {
              console.log("Element is in the viewport!");
              //You can modify the logic if required
              document.body.style.overflow = "hidden";


              if (progress === 100 || progress <= 0) {
                document.body.style.overflow = "auto";
              }
              observer.unobserve(entry.target);
            }
            else {
              console.log("Element is not in the viewport!");
              document.body.style.overflow = "auto";
            }
          });
          threshold: 0.8 // Set the threshold to 0.8 (80%)
        });


        const targetElement = document.getElementById("creator-exp");


        if (targetElement) {
          observer.observe(targetElement);
        }
      }
    </script>
  </body>
</html>

Please refer to the above sample code to easily integrate our experience into your webpage.

PreviousIntegration of Experiences via Creator (React Package)NextGetting Started

Last updated 1 year ago

๐Ÿ› ๏ธ
๐Ÿ› ๏ธ