Skip to main content
Version: v25

NPM

caution

This is an experimental feature. Using the library as an NPM dependency only works for recent versions. If in doubt you can check if a package.json file is included in the repository for a commit. For example version 23.041 πŸ” (restricted access) does not have a package.json file in the root of the repository, so version 23.041 cannot be used with NPM.

How to​

For now we do not support specifying the library version using a version number. A specific commit hash must be used. You can see the list of commits on GitHub πŸ” (restricted access) to find the appropriate hash.

Add the library to your dependencies in your package.json file. For example:

{
"dependencies": {
"charting_library": "git@github.com:tradingview/charting_library.git#COMMIT_HASH_HERE"
}
}

Then run npm install as usual.

info

The repository is private. npm install will only work if the git client is logged into an account with access to the repository. See Getting Access for more information on how to gain access.

Remember that you will still need to host the static files that the library distributes. They can be found in node_modules/charting_library/charting_library.