Registry / communication / tableau-api

tableau-api

JSON →
library2.2.3jsnpmunverified

NPM wrapper for the Tableau JavaScript API (v2.2.3, last release December 2020). This package provides a convenient way to include the Tableau JS library in Node.js or browser bundlers (Webpack, Rollup). It mirrors the official Tableau JS API, which allows embedding Tableau visualizations, interacting with workbooks and sheets, and extracting underlying data. Key differentiators: simplifies dependency management for Tableau JS compared to manual script tags; however, it lags behind the official CDN version (current Tableau API is v3.x). Release cadence is low (last update in 2020). For new projects, prefer the official CDN or the '@tableau/embedding-api' package.

npm install tableau-api
INSTALL
IMPORT
SIG · TABLEAU-API
T
tableau-api
communicationjavascriptv2.2.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (tableau)
import tableau from 'tableau-api';
const tableau = require('tableau-api');
ESM import is preferred; CommonJS require also works but is not tree-shakable.
Viz
const viz = new window.tableau.Viz(container, url, options);
const viz = new tableau.Viz(container, url, options);
tableau is attached to window; after importing tableau-api, use window.tableau objects.
Worksheet
const sheet = viz.getWorkbook().getActiveSheet().getWorksheets().get('Table');
const sheet = viz.getWorkbook().getActiveSheet().getWorksheets()[0];
Worksheets collection uses .get(name) not array indexing.

Embeds a Tableau visualization and logs underlying data when interactive.

import tableau from 'tableau-api'; const container = document.getElementById('vizContainer'); const url = 'https://public.tableau.com/views/WorldIndicators/GDPpercapita?:embed=y'; const options = { hideTabs: true, width: '800px', height: '600px', onFirstInteractive: () => { const sheet = viz.getWorkbook().getActiveSheet(); sheet.getUnderlyingDataAsync().then(data => console.log(data)); } }; const viz = new window.tableau.Viz(container, url, options);
Debug
Known issues
gotchaUsing window.tableau.Viz instead of imported tableau.Viz: the package only adds the tableau script to window; direct named imports like tableau.Viz do not exist.
fix
Always use 'new window.tableau.Viz(...)' after importing 'tableau-api'.
affects: *
deprecatedTableau JS API v2 (embedded in this package) is deprecated by Tableau; v3 is available via CDN or @tableau/embedding-api.
fix
Migrate to @tableau/embedding-api or use CDN script for v3.
affects: 2.0 - 2.2.3
gotchaImporting in server-side rendering (SSR) environments: package expects browser globals (window, document) which are not available in Node.js.
fix
Use dynamic import or only load in browser environment.
affects: *
breakingBreaking change: In v2.1, the package switched from bundling the full Tableau JS API to referencing the CDN, breaking users who depended on the bundled version.
fix
Pin to v2.0 if you need bundled version.
affects: >=2.1 <2.0
deprecatedThe 'getUnderlyingDataAsync' method previously returned a promise with .getData() method; now returns data directly? Check Tableau docs.
fix
Refer to official Tableau JS API docs for current return types.
affects: >=2.0
Errors
Common errors & fixes
TypeError: tableau is not defined
Imported package but forgot that tableau is attached to window.
fix
Use 'window.tableau.Viz(...)' instead of 'tableau.Viz(...)'.
Uncaught ReferenceError: window is not defined
Code running in Node.js or SSR where window is not available.
fix
Ensure code runs only in browser; use dynamic import or conditional check.
Cannot read property 'Viz' of undefined
tableau-api not properly imported or CDN script not loaded.
fix
Wait for tableau script to load: use 'tableau' global, not import.
Module not found: Error: Can't resolve 'tableau-api'
Package not installed or not in node_modules.
fix
Run 'npm install tableau-api' and ensure correct import path.
Upgrade
Version history
2.2.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
16
Bingbot
1
OpenAI (training)
1
Resources
tableau-api — npm install tableau-api · libregistry