Wouldn't you want to not give the client any information about the correct answer? I would think you would want to have a `POST` command that gives you the encoding guesses if you truly want to keep it out of the browser.
Something like homomorphic encryption or a trusted enclave on the client could work here but unless there's money involved that's probably gross overkill.
I'd go with the server-side solution and API personally but if I had to pick a mechanism for client-side I'd probably do something like AES encryption with a generated key. The actual secret would look like garbage and the key wouldn't show up anywhere on the wire so the attacker would have to actually reverse engineer the key generator.
All that said most of the "attacks" I've seen on the wordle problem just optimize the guessing strategy which is way easier than trying to figure out de-obfuscation of the secret.