i did almost the exact same thing except i wanted the client to enforce the same logic as the server would without having to do api request on every action or having 2 implementations so i just compiled the library code to wasm and that way both the server and the client share the same logic