The second line has something wrong, you’re not supposed to pass in a header like that. Which backend server are you using? That code by itself won’t do anything without a web server. Here’s an example Repl showing how you can use Replit Auth along with Express.js. Remember that for Replit Auth to work, you need to enable it first, under Tools > Authentication on the left sidebar, and then enable the default login page (or you can make your own if you want to, but I won’t get into detail on that).
You need to intercept a request and use the request as the first parameter. All the function really does though is get certain heard starting with X_REPLIT_. You need a server for this to work. Here’s an example using express: