# Can I use drop in API Components in client side (ReactJs) directly? CORS Policy Error

**URL:** <https://discuss.dwolla.com/t/can-i-use-drop-in-api-components-in-client-side-reactjs-directly-cors-policy-error/7812>\
**Category:** API Support\
**Created:** [February 7, 2022, 1:26pm UTC](https://discuss.dwolla.com/t/can-i-use-drop-in-api-components-in-client-side-reactjs-directly-cors-policy-error/7812 "2022-02-07T13:26:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ank](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/ank/32/3373_2.png) [@Ank](https://discuss.dwolla.com/u/Ank)\
**Post date:** [February 7, 2022, 1:26pm UTC](https://discuss.dwolla.com/t/can-i-use-drop-in-api-components-in-client-side-reactjs-directly-cors-policy-error/7812/1 "2022-02-07T13:26:10Z")

</div>

I am trying to call this function in my frontend but I am getting the error below

**Access to XMLHttpRequest at ‘[https://api-sandbox.dwolla.com/token](https://api-sandbox.dwolla.com/token)’ from origin ‘[https://localhost:3000](https://localhost:3000)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.**

**So I want to know if any Dwolla API calls can be used in frontend Directly** or **if I have to use all the APIs on the Server End**  
Code-  
axios(`https://api-sandbox.dwolla.com/token`,  
{  
method: ‘GET’,  
headers: {  
Accept: ‘application/vnd.dwolla.v1.hal+json’,  
Authorization: `Bearer ${dwollaToken}`  
}  
}  
);  
const { \_links: payload } = rootResponse.data;  
return payload;  
} catch (err) {  
console.error(err);  
return err;  
}  
}

---

<div class="post-metadata">

**Author:** ![spencer](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/spencer/32/2143_2.png) [@spencer](https://discuss.dwolla.com/u/spencer)\
**Post date:** [February 8, 2022, 5:26pm UTC](https://discuss.dwolla.com/t/can-i-use-drop-in-api-components-in-client-side-reactjs-directly-cors-policy-error/7812/2 "2022-02-08T17:26:10Z")

</div>

Hi @Ank , this looks to be the same error response as the thread below. Please let us know if you have any follow up questions after reviewing!

> [@CORS header missing on HTTP 201 response](https://discuss.dwolla.com/t/cors-header-missing-on-http-201-response/7817/2):
>
> Hi @mikewhat , Dwolla’s API blocks CORS requests for security purposes. Referenced in this thread: [Dwolla.post giving me a CORS error - #2 by shreya](https://discuss.dwolla.com/t/dwolla-post-giving-me-a-cors-error/7652/2) I’d recommend either moving these calls to your back-end server or utilize our [drop-in components library](https://developers.dwolla.com/concepts/drop-in-components) which is allows you to utilize pre-built UI components to make isolated calls to Dwolla.
