dou
dou
TtRPC
Created by dou on 11/9/2023 in #❓-help
How to obfuscate data via transformer
End user with adequate knowledge can easily copy JSON data in plain text from network requests in browser dev tools. I'd like to make copying JSON data a bit more difficult for these advance users. Looks like obfuscation needs to be done in transformer. Does anyone have ideas how to implement obfuscation along with superjson within transformer?
import { uneval } from 'devalue';
import superjson from 'superjson';

export const transformer = {
input: superjson,
output: {
serialize: (object) => uneval(object),
deserialize: (object) => eval(`(${object})`),
},
};
import { uneval } from 'devalue';
import superjson from 'superjson';

export const transformer = {
input: superjson,
output: {
serialize: (object) => uneval(object),
deserialize: (object) => eval(`(${object})`),
},
};
5 replies