CommonJS / Node

ESM / TypeScript

Browser

The dist/browser/ynab.js file (located in node_modules/ynab after installation) is specifically built to run in a browser / window context and exports ynab variable to global namespace. No other dependencies are needed.

<script src="ynab.js" async></script>
...
<script>
// This assignment is not necessary but demonstrates that
// once the library is loaded, the global 'ynab' object will be available.
var ynab = window.ynab;
</script>

CDN

A simple way to load the library in a browser is by using the unpkg CDN, which is a
"fast, global content delivery network for everything on npm". To use it, include a script tag like this in your file: