Update support widget example code to not throw tsc errors

One possible fix could beconst win: Window & { Featurebase: any } = window as any;
- Post type
- 68097ad297a301c207158357
- What part of Help Desk?

One possible fix could beconst win: Window & { Featurebase: any } = window as any;
Log in to comment and vote
Comments3
Alex Z
May 9, 2025
Honstly, this is a nitpick. I’m in PR review mode :) This could simply be
const win = window any. I’m realizing now that you have a js example, not ts.Erik Kaljumäe
May 9, 2025
Hi @TPTM!
Thanks for the feedback - would you be able to expand on your TS setup (framework & bundler)?
I’m thinking that maybe we could add a global type declarations snippet with a TS example.
The snippet would append the typings to the
windowobject, which would allow for the autosuggestions and types to work - and let it through a tsc transpiler that doesn’t allow usinganyorunknowntypings.Would that improve the developer experience?
Alex Z
May 9, 2025
Yes, that would help. Ultimately, I think it would help the developer experience if they didn’t see the red lines when copying and pasting this code in typescript files.
For better typescript support for at least react projects, it would be great to have an official wrapper along these lines
https://feedback.featurebase.app/p/official-react-npm-package-with-typescript