# JavaScript Bundling Most applications should use {doc}`../guides/html-output` to produce a complete interactive page. Use the bundling API when you are building your own web integration and need one JavaScript file containing compatible versions of Vega, Vega-Lite, and Vega Embed. ## Get the Standard Bundle ```console $ vl-convert bundle-js --vl-version 6.4 --output vega-embed.js ``` The standard bundle exposes `vega`, `vegaLite`, and `vegaEmbed` on `window`, so browser code can use them without module imports. Select the same Vega-Lite version that the browser will render. ## Add an Application Snippet A snippet is bundled in the same module scope, so it can refer to `vega`, `vegaLite`, and `vegaEmbed`. It must not import anything outside the dependencies bundled with VlConvert. For example, save this as `snippet.js`: :::{dropdown} snippet.js :open: ```{literalinclude} /_examples/bundle-snippet.js :language: javascript ``` ::: ```console $ vl-convert bundle-js \ > --snippet snippet.js \ > --vl-version 6.4 \ > --output app-chart.js ``` The resulting `app-chart.js` defines the wrapper. This complete page loads the bundle and calls it with a Vega-Lite specification. Save it as `index.html` beside `app-chart.js`, then open it in a browser: :::{dropdown} index.html :open: ```{literalinclude} /_examples/bundle-demo.html :language: html ``` ::: Bundling runs build tooling on caller-supplied source. Apply authentication, body-size limits, and request budgets before exposing the server endpoints to other users.