You don't need the smart TV's code. It's just a device connected with HDMI to any HDTV.
https://www.google.com/search?q=Karaoke+on+smart+tv+with+Chromecast+or+Apple+TV&gl=US finds such setups but I've never tested these.
My wife saw somewhere "an object" that can make you sing the karaoke by connecting to the smart tv. Now she wants the same but she doesn't know what it is
From her description I guess it must be Apple TV or Chrome Cast. Then one sings by searching on the youtube the free songs with karaoke lyrics, connects the smartphone to the smart tv by using a chromecast or apple tv dongle, and connects a microphone to the sound system.
Which is the best setup for this sort of thing? We both have Iphone while some friends have android phones, so perhaps the best would be chromecast or similar (also for price reasons). The tv is LG I don't remember the exact product code right now but it is smart tv for sure, shoulde be compatible with chromecast and apple tv