Stating with Tableau 2021.4, the Embedding API v3 library is available for use on Tableau Server, Tableau Online, Tableau Public, and on the Tableau CDN. To add the Embedding API to your web pages and applications, you simply link to the library.
In this section
The Embedding API library contains functions for interacting with the Embedding API. The Embedding API library is available in multiple versions, and each version of the library corresponds to a specific version of Tableau. Additionally, for each version of the Embedding API file, there is also a minified file (
.min) that you can use in production environments to reduce the amount of data that browsers need to download.
The following table lists the Embedding API v3 library files and the corresponding versions of Tableau. For compatibility, you should use the version of the library that matches the version of Tableau you are using.
|Tableau Version||Embedding API v3 Files|
You can access non-minified versions of the library by removing
.min from the filename, for example,
tableau.embedding.3.3.0.js. Use the non-minified version of the library during development as it can help when you need to debug your embedding code.
For convenience, you can link to latest version of the library (
tableau.embedding.3.latest) rather than the specific version for the release (3.0.0, 3.1.0, etc.). The file (
tableau.embedding.3.latest.js) will always point to the most recent release of the library on that instance of Tableau.
The file (
tableau.embedding.3.latest.js) is only available on Tableau Server, Tableau Online, and Tableau Public. If you use the Tableau CDN (
https://embedding.tableauusercontent.com/), you need to link to the specific version of the file that you want to include.
Starting with Tableau 2021.4, you can get the Embedding API v3 library from multiple locations, including Tableau Server, Tableau Online, Tableau Public, and the Tableau CDN (
https://embedding.tableauusercontent.com/). As a general rule, you should always get the Embedding API v3 library from the same Tableau instance that hosts your visualizations. This ensures that you always use a version of the library that is compatible with the version of Tableau you are using.
Note that you cannot link to a local copy of the library (using
file://), as it will cause Cross-Origin Resource Sharing (CORS) errors. You must link to the library on Tableau or the Tableau CDN, or on a server over HTTPS.
type attribute to
module in the
Note that you can only use the Embedding API v3 library when you are embedding views from Tableau 2021.4 or later. If you use an incorrect version of the API with Tableau Server, Tableau Online, or Tableau Pubic, you will see a version incompatible error.
For Tableau Server 2021.4 and later, add the following code to a web page to link to the latest Embedding API v3 library:
YOUR-SERVER with the name of your Tableau Server. For example, if your server is www.example.com, to use the Embedding API v3 library you would include this line in your HTML page:
For Tableau Online, use the following:
For Tableau Public, use the following: