Using NPM
How to use Koala’s npm packages for instrumentation
Instrumenting with NPM Packages
You can choose to instrument your website using our npm packages when instrumenting Koala directly via script tag is not a possibility.
When to use one of the Koala NPM packages?
- If you want to pin versions of the Koala SDK and not rely on the dynamically generated ones from our CDN
- When you want to add typescript types for Koala in your project
- You want to use React hooks in your Koala tracking
- When you want a tighter integration with your build or type system
Using the generic Browser package
We ship new versions of our SDK to NPM on every release, all releases of the Koala SDK will be available on the @getkoala/browser
package on NPM.
The browser package includes the most recent bundled version of our SDK.
- Install the npm package
- Load the Koala SDK
- Load your project
- Use the Koala SDK Once you’ve loaded your project, you should be able to use all methods from the Koala SDK normally on your website
We recommend using our inline script tag whenever possible, so you can leverage our fast CDN times and the latest updates, features, and bug fixes whenever they’re available.
Using the React package
Koala also works with Typescript and React. You can install the @getkoala/react
package to start using Koala directly in your React app.
You can find more in-depth and up to date guides on our getkoala/react github repo.