# Postman to frontend

**URL:** <https://community.postman.com/t/postman-to-frontend/36056>\
**Category:** Help Hub\
**Tags:** async\
**Created:** [June 8, 2022, 4:56pm UTC](https://community.postman.com/t/postman-to-frontend/36056 "2022-06-08T16:56:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dxlmx](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@dxlmx](https://community.postman.com/u/dxlmx)\
**Post date:** [June 8, 2022, 4:56pm UTC](https://community.postman.com/t/postman-to-frontend/36056/1 "2022-06-08T16:56:31Z")

</div>

**The question:**  
I think I have the API proxi url that I can use to bring the content to the front end with js with this instructions ([Integrate Postman into your development toolchain | Postman Docs](https://learning.postman.com/docs/developer/intro-api/)). Do I still need the bearer token and where do I declare the x-rates?  
A snippet would be awesome.  
I need the postman send request results to display on the front end, using plain javascript.  
(don’t suggest node js 🙂 I can’t use it for this particular project).

**Details**  
Directly accessing the api w/the Postman snippet doesn’t work, and it would be a security issue.

**How I found the problem:**  
I tried both an async and reg function call using the provided postman snippet  
CORS is an issue, but also I need a way to do this w/out displaying the tokens to the public

**I’ve already tried:**  
Used a live website page so the code wouldn’t be on a local desktop, but it looks like I can’t access the API directly this way.

**update**  
I created a mock server and an api key, and x-api key. A pointer to a code snippet with them would be awesome  
Also this is the code I would be using, based on the snippet in postman. (REDACTED TOKENS), but using the api key, would I still need the bearer token, I’d think not. and would the;  
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset be delcared in the api string w/the request

```auto
"use strict";

function asyncCall() {

var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer REDACTED");
myHeaders.append("Cookie", "guest_id= REDACTED");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("PMAK-62a0d9932d337033e1722c80-3c9250198d077e8d79bb72f1c6e55e427dhttps://api.REDACTED=attachments,id,text&user.fields=id,name,username", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
/*
try{
  const response = await fetch("https://api.REDACTEDmax_results=10&tweet.fields=attachments,id,text&user.fields=id,name,username", requestOptions);
  const responseText = await response.text();
  console.log(responseText);
}
catch (error) {
  console.log('error', error);
}
*/

}

asyncCall();

```

Thank you
