You need to sign in to do that
Don't have an account?
Jonathan Crow 6
Lightning Web Component to fetch api
I am trying to fetch data from an API. I took a look at this recipe from the LWC Recipes: https://github.com/trailheadapps/lwc-recipes/tree/main/force-app/main/default/lwc/miscRestApiCall
But I need to authenticate the call to the API with my API Key and have no idea how to do that.
Can anyone point me to any resources for doing this in LWC?
But I need to authenticate the call to the API with my API Key and have no idea how to do that.
Can anyone point me to any resources for doing this in LWC?
>> https://developer.salesforce.com/blogs/2020/04/how-to-securely-access-salesforce-with-lightning-web-components-open-source.html
This link has details in regards to authentication on the server-side and also client-side authentication.
Additionally, you can try checking this link as well : https://blog.salesforcecasts.com/using-fetch-api-in-lwc/
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.