Overview and Setup
The Companion SDK enables you to extend the functionality of the companion, for example by providing custom metadata for created annotations.
🚨 This SDK uses browser APIs and thus is only prepared for client-side rendered applications. If you use server-side rendering / RSC / etc. make sure that the functions provided in this SDK are part of the client-side bundle and only executed in the client environment. To check if the code is executed client side, it should be sufficient to check for the existence of the global `window` object.
Installation
The SDK is available as a npm-package, so you can easily install it with your favorite package manager. So in our case it is:
pnpm install @stagewise/companion-sdk
And you are ready to go. To see how you can add custom metadata to your annotations with a single function call, check out the next chapter on integrating custom metadata.