Auth0-spa-js VS auth0-react

I have found my way to two different React libraries

GitHub - auth0/auth0-spa-js: Auth0 authentication for Single Page Applications (SPA) with PKCE
and
GitHub - auth0/auth0-react: Auth0 SDK for React Single Page Applications (SPA)

What’s the difference between these two?

Hi @warrick.fitzgerald,

Welcome to the Auth0 Community!

The main difference between the two SDK’s that you shared with me is the type of framework you use for your SPA.

As seen in our Quickstart documentation, we offer support for React, Angular, and Vue and Javascript SDK’s for Single-Page Applications.

Under the hood, the Auth0 React SDK implements Universal Login and the Authorization Code Grant Flow with PKCE. In essence, the two SDK’s you shared with me are functionally the same.

This is because Single-Page Applications are public clients and cannot store any secrets. Hence why SPA’s implement PKCE for token exchange. See here for a more detailed explanation.

In this case, if you plan on developing your application with React, then the appropriate SDK to use is the Auth0 React SDK. Similarly, for the other frameworks.

Otherwise, the appropriate SDK to use with your Javascript app is the Auth0 spa-js SDK.

Hoped this helps! Please let me know if you have any questions.

Thank you.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.