Set up for the course
In this lesson, we’ll go through the requirements to get set up for the course. By the end, you’ll have the setup, tools, and resources required to complete the embedding steps in this course.
The objectives of this lesson include the following:
-
Ensure the pre-conditions for embedding are met
-
Review ThoughtSpot Embedded Documentation resources
-
Familiarize with Developer’s Playground
-
Download the starter code
Pre-conditions🔗
You’ll need a ThoughtSpot user account with developer privileges and access to ThoughtSpot Embedded features. If you don’t already have an account, you can create a trial account that’s good for 14 days and has ThoughtSpot Embedded enabled.
You will also need the following:
-
A modern web browser.
We’ll use Google Chrome in the examples, but you should be able to use other browsers like Mozilla Firefox or Safari.NoteIn this tutorial, we will use a cookie-based session, so you need to enable third-party cookies / cross-site tracking, which some browsers disable by default.
-
A text editor for editing code.
You can use any text editor, but an IDE that supports HTML, CSS, and Javascript will work better. The examples in this course use Visual Studio Code,a popular IDE for web development. -
A web server to run the code.
We’ll be running a very basic web application, so you don’t need a complex web server. This course will use Live Server which is available in the Visual Studio Marketplace. With this installed, you can start and stop the server with a single click.
Review ThoughtSpot Embedded documentation🔗
ThoughtSpot provides detailed documentation about embedding and the SDK. There are two places you can get the documentation:
-
On this site: https://developers.thoughtspot.com/docs
-
Via the Guide link in the Develop page in ThoughtSpot UI
The following figure shows the links to Visual Embed SDK Guide and the REST API Guide.
Get familiar with the playground🔗
To open the Playground, go to Visual Embed SDK > Playground on the Develop page. The playground lets you quickly and easily generate working code that you can embed into your application.
The following figure shows the Playground page for embedding Natural Language Search.
The image above has three main sections:
-
The first section shows a preview of your embedded analytics. As you make changes and run the code, you get to see the results instantly. This is how the code would look like in your application (ignoring any style differences). This is a great benefit to using the Playground, because errors will also show up.
-
The second section allows you to choose different options. At the top is a dropdown that lets you specify the type of content you are embedding. The options below the dropdown differ based on the content selected.
-
The third section is the code that is being run. This code is interactive and can be modified and executed using the Run button. The code can be updated using the selections in section two or by modifying the code directly. The code section has smart code completion that can help enter the appropriate values.
Download the code🔗
Before beginning, you should download the code from GitHub. The recommended approach is to use the git clone
command to make a local copy, perhaps after forking the code base. If you don’t want to take this route (or don’t know what those commands are), you can download the code using the Download Zip option as shown in the following figure:
Activities🔗
-
Explore the documentation site.
-
Log in as a Developer and explore the Develop page. All users on the free trial instance have Developer privileges.
-
Open the Visual Embed SDK Playground, modify content, and run the resulting code to become familiar with the code.
-
Download the code or clone the repository.