Embedding Lessons On a Website You Own

Last updated 17 days ago

How to embed a lesson into any website you can modify the HTML for.

There are three ways you can embed a lesson into a website. All of them are available via the share icon on the left sidebar, under the Website section.

Using a Publishable Key

This method does not support persistent code, but is the easiest form of embed. You can copy and paste this code into any website.

This embed type may only be used for testing purposes. For production usage, authenticated embeds are required.

Using an Access Token

This method supports persistent code and requires you to generate an access token, as described in our API documentation.

Using a Publishable Key + Custom User Data

This method supports persistent code and doesn't require you to generate an access token, making it a good balance of functionality and effort.

To use this form of embed, copy / paste the code provided into any webpage you'd like. Then, ensure that a JavaScript variable like the following is available:

window.CodevolveUser = {
"id": "1234",
"first_name": "Codey",
"last_name": "Coder",
"email": "codey@codevolve.com",
"security_check": 123456789

All these values must be present for this embed to work. They are described below:

  • id (string or number): A unique, persistent value for the user, such as their ID in the database.

  • first_name / last_name (strings): The user's first and last names, respectively.

  • email (string): The user's email address.

  • security_check (number, string): A second unique, persistent value for the user (such as a timestamp for when they were created). Used to prevent malicious project access.

The user's ID, name, and email will be available when exporting data via Zapier.