-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppor for React Native Web #699
Comments
Hi @sreuter Thanks a lot for raising this. We had plans to support this but de-prioritized considering this is not an official support. However we are very interested in knowing what the community thinks and we would be happy to support if there is enough demand for the feature. Do feel free to add more to the discussion. We will leave this issue open to get more feedback from the community |
What exactly do you mean by "this is not an official support"? I agree with @sreuter on this. Web for React Native is becoming more and more a common target as the Web support has got better in recent times. Not to mention Expo's new router really makes the web an even more viable option with file-based URL routing and SEO concerns being addressed. This is surely going to be requested more moving forward. Sounds like you all were already kind of planning on it being one, but have decided against it for the time being, I'd recommend to re-visit it. |
@poovamraj it's strange this isn't official support since react for web is and react-native is, react-native web is just react for web at the end of the day, it just needs to be integrated into the Using Expo snack to test this Auth0 library will not work by default since Web is the default platform in the most common tool for providing Expo project snippets... |
Thanks a lot for the valuable feedback @KMathisGit @Jackman3005. We were looking forward to such conversation with the community before providing support for Web in React Native. @Jackman3005 can you provide a sample or overview of how you achieved the solution @KMathisGit If you can elaborate on the issues you are facing it would help us understand the issues faced by the community. |
@poovamraj Sure. Essentially I created two files called These files export a Context Provider. The Context is a common interface to accomplish my application's goals without knowing whether we are working with the native or web implementations of Auth0. Here are the types for the common Context that my application consumes: export type LoginAppState = {
url?: string;
identifier?: string;
priorLogin?: {
accessToken: string;
};
};
export type IAuth0Context = {
openAuth0UniversalLogin: (options: {
appState: LoginAppState;
identifierHint?: string;
connection?: string;
}) => void;
isAuthenticationResultAvailable: boolean;
getUniversalLoginResult: () => Promise<
UniversalLoginError | UniversalLoginSuccess
>;
logoutAuth0: (redirectPath?: string) => Promise<void>;
};
export type UniversalLoginError = {
success: false;
error: unknown;
};
export type UniversalLoginSuccess = {
success: true;
accessToken: string;
refreshToken: string;
savedAppState?: LoginAppState;
}; Please note that I am not suggesting this library implement the interface exactly as I have done here, but rather this is just an example of what I've had to go through to create a common interface for my application to work with Auth0 both on Native and Web. Note that My implementation only covers aspects of the Auth0 implementations that I needed access to and I imagine a complete solution would contain this and more code. Alternatively the libraries could adjust their current APIs to be more similar to one another and it would reduce the work needed to manually massage them into a common format. |
The issues I face are the exact same as those that @Jackman3005 has elaborated on. Since we target both platforms (web and native mobile) we need to create our own abstraction layer that will handle which package to use based on current platform. From a consuming perspective of the package it really feels like it ought to be baked in. No good reason that consumers should have to create their own abstraction layer for something as common as wanting to use auth0 across both platforms. |
Thanks for the suggestions @Jackman3005 @KMathisGit. We will keep this thread open to hear more from our community and I will notify here on how we are planning to proceed ahead. |
I am about to need to implement a similar solution as Jackman3005 did. Our client is using RN with RNW for cross-compile. Would love to just use the RN package for Okta here with an officially supported implementation. +1 |
Also needing to roll my own abstraction layer, to detect the platform the client is on. Very Annoying. +1 from me to please add this support. To pass along some feedback, it would be very nice if your quick start guides for both EXPO and React Native Mention a section for "Web" currently only IOS and Android are even mentioned on how to set it up. A warning disclaimer or, a section labeled "Web" with details stating it is not currently supported would save your customers time on looking up why it isnt working out of the box! :) |
@poovamraj any update on roadmap for this? Is this something we might expect sometime soon? |
@kevlil83 will be providing an update over this soon in the thread. |
@poovamraj @kevlil83 Any update on this? We are also doing a mixture of what is said above (separate handling of web and native in a wrapper component), but would love to consolidate. |
Count me as another developer facing this issue who'd like to see a solution asap. |
have this been addressed? Im looking for such a solution as well |
Apologies for the radio silence here. We are planning to support this along with other improvements in the next major release coming up this quarter. I'll share exact timelines by the mid of June. cc: @sreuter @Jackman3005 @KMathisGit @brushton-ces @gfriedm4 @ThomasGHenry @driscollwebdev @krolow @steventnorris @Katerlad |
hey @brth31 , any update on the timeline for the react native web support! |
it's end of July, any updates? |
Apologies for the delay here. We were busy with a major version release of the React Native SDK last month. React Native Web will be supported in the upcoming release scheduled for early October. |
Hi @agrittiwari, Yes, we would definitely encourage you to contribute to this feature in the mean time. You can target the branch here |
Hi there, @brth31! Any news on this issue? |
@dmazoli Thanks for your patience! Unfortunately, we weren't able to prioritise this for October. We are planning to address this by the end of this year. |
Update: Unfortunately, we won't be able to support this by the end of the year. We are tentatively looking at the end of Jan to begin working on this. |
Any updates on when work will start on this and when it's likely to be available? |
Checklist
Describe the problem you'd like to have solved
React Native Web is commonly used these days along the Android & iOS targets. It would be awesome if this library could support it as well, so users wouldn't need to handroll their own solution for the web target.
Describe the ideal solution
A developer can use this library for React Native Web, iOS & Android.
Alternatives and current workarounds
Handroll your own solution for React Native Web.
Additional context
No response
The text was updated successfully, but these errors were encountered: