window is not defined error while integrating comet chat with angular app having ssr

I am trying to integrate comet chat SDK in my angular app having SSR. I am getting errors while using functions from the SDK like the window is not defined.