Web

 
How to embed MyGuide player in a website


< script​​​​ >
    if (!window.guideMe) window.guideMe = {};
window.guideMe.baseUrl = '//cdn.guideme.io/guideme-player/ent/';
var a = document.createElement('script');
a.src = guideMe.baseUrl + 'guideme.js';
document.head.appendChild(a); < ​​​​/script>

  • Copy the above code.
  • Insert it at the end, just before the </body> tag. 
  • Reload the HTML page and see MyGuide in action.

Setting up auto login
< ​​​​script​​​​ > window.myGuideOrgKey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmdfa2V5IjoiYWYwZGYxZDNjZjI0NTFhMjIxMjI3MzQ4MzYyNDBjNGIifQ.mBb8EHMwItahuHLVHBUBTTn74FFb4tKUs0ZtASCfnt4"
if (!window.guideMe) window.guideMe = {};
window.guideMe.baseUrl = '//cdn.guideme.io/guideme-player/ent/';
var a = document.createElement('script');
a.src = guideMe.baseUrl + 'guideme.js';
document.head.appendChild(a); < /script>

  • You need myGuideOrgKey to enable auto login for your users.  
  • You can statically set myGuideOrgKey in your embed code once (as shown in the example above).
  • You can dynamically set the window.myGuideOrgKey variable on page load. In this case, you will only need the first embed code and MyGuide code will automatically read 'myGuideOrgKey' from the 'window' variable. This option secures the org key and secret key.

Generating myGuideOrgKey

  • You need org key and secret before proceeding to the next steps. If you don't have it, please follow https://dev.myguide.org/docs/web/v1/api_key_secret
  • myGuideOrgKey is a JWT token. To generate one, please visit https://jwt.io/
  • Scroll down on the page. In 'PAYLOAD' section, add this JSON {"org_key":ORG_KEY}, where ORG_KEY is MyGuide org key.
  • In 'VERIFY SIGNATURE' section, replace "your-256-bit-secret" by the MyGuide org secret. 
  • The JWT token generated in the left panel is your myGuideOrgKey

Last Updated: 2020-08-21 10:58am. (GMT)