Curl Command in Javascript

Depends what language your backend is, but essentially yes, most languages just wrap cURL

You on about how to construct a API request to provide your access token or how to get an oAuth token to use?

I already linked you a fetch example

Here is a nodeJS “regular oAuth” example https://github.com/BarryCarlyon/twitch_misc/tree/master/authentication/user_access_generator/nodejs

Which covers how to get a token and then use that token, (line 147 in server.js is the got example on getting the authenticated users profile)