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.

Hey there!

As this topic is related to Rules - Hooks - Actions and Rules & Hooks are being deprecated soon I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!