nextjs-auth0
nextjs-auth0 copied to clipboard
Improve initAuth0 documentation
Checklist
- [X] I have looked into the README and have not found a suitable solution or answer.
- [X] I have looked into the examples and have not found a suitable solution or answer.
- [X] I have looked into the API documentation and have not found a suitable solution or answer.
- [X] I have searched the issues and have not found a suitable solution or answer.
- [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- [X] I agree to the terms within the Auth0 Code of Conduct.
Describe the problem you'd like to have solved
The section in the documentation described as 2. Create your own instance using InitAuth0 states the following:
Note If you use InitAuth0, you should not use the other named exports as they will use a different instance of the SDK.
I think this is misleading because there are some named exports that are not present in the resulting object of the initAuth0 call. Examples I've found so far: useUser and UserProvider.
Describe the ideal solution
Either change the documentation to list which methods should be used from the InitAuth0 result or add the other functions there as well.
I think the second will be simpler for the developers because it allows you to do a quick search and replace.
Alternatives and current workarounds
No response
Additional context
No response
Thanks for raising this @jfromaniello
I think this is misleading because there are some named exports that are not present in the resulting object of the initAuth0 call. Examples I've found so far: useUser and UserProvider.
Yep, the exceptions are the front end only exports as initAuth0 is only for instantiating an instance of the SDK for the server. Let me have a look at the docs and see if I can clarify this a bit better