How to create a useApi Hook?

I am using Auth0 with React and I desperately need some guidance on how to create a useApi hook. The funny thing is that “supposedly” you guys have one in your Github examples, but the link to view it does not work, it does not take you to any code or explanation. Here is the link to the page, just search for “useApi” and you will see that the links don’t go anywhere.

Does anyone know of any other resources where someone has created a useApi hook with Auth0???

1 Like

Hey there!

Thanks fro raising that! Can I actually ask you to create it as a GitHub issue in the auth0-react repo so we can work on that directly with the SDK maintainers? Once you have a link to it make sure to share it here with us so we can ping them. Thank you!

Here is the issue that I created on GitHub. Hopefully we will hear back from them soon.

The issue was closed with an answer of sorts but the problematic link still exists here:
https://auth0.com/docs/quickstart/spa/react/02-calling-an-api#get-an-access-token

1 Like

Hey @af7777 welcome to the community and thanks for sharing! I’ve submitted a PR to update our docs.