K
Kinde•2mo ago
Ewan

Is there any way to use Kinde with react native Expo Web?

I've been using Kinde for a while now and love it. We are moving from a pure swift iOS app to an Expo app which will be targeting iOS, Android and Web. However, it seems the Kinde Expo SDK doesn't support web and only supports iOS and Android. Is there any way to enable support for web as otherwise this will be a blocker to us using Kinde and I'll need to move off it which I don't want to do. Is it possible to use the javascript or react sdk in combination with the expo one so that we can target web? or are there any plans to allow targeting web in the normal expo SDK? Thanks!
3 Replies
Roshan
Roshan•2mo ago
Hi, Thanks for reaching out!

the Expo SDK is specifically designed for React Native applications and focuses on mobile platforms (iOS and Android). However, you have several options to achieve web support alongside your Expo mobile app: Option 1: Use Kinde's React SDK for Web You can use Kinde's React SDK for your web platform while keeping the Expo SDK for mobile. This approach allows you to: - Use @kinde/expo for iOS and Android platforms - Use @kinde-oss/kinde-auth-react for web platform Both SDKs provide similar authentication flows and token utilities, so you can maintain consistent user experiences across platforms. Option 2: Platform-Specific Implementation Since Expo supports platform-specific code, you could conditionally import and use different Kinde SDKs based on the platform:
import { Platform } from 'react-native';

// Platform-specific Kinde imports
const KindeAuth = Platform.select({
web: () => require('@kinde-oss/kinde-auth-react'),
default: () => require('@kinde/expo'),
});
import { Platform } from 'react-native';

// Platform-specific Kinde imports
const KindeAuth = Platform.select({
web: () => require('@kinde-oss/kinde-auth-react'),
default: () => require('@kinde/expo'),
});
Authentication Flow Compatibility Both SDKs support the same core authentication methods, the main difference is in the platform-specific implementation details, but the authentication tokens and user data remain consistent across platforms. Application Configuration You'll need to configure your Kinde application to support both mobile and web callback URLs: - Mobile: <myapp://localhost:3000> - Web: https://yourdomain.com/callback This multi-platform approach is a common pattern for Expo apps that target web, and Kinde's architecture supports this use case through its different SDKs targeting specific platforms.

Let me know if this helps, thanks
Ewan
EwanOP•2mo ago
Ok great thanks for the help! Will give that a go 🙂
Roshan
Roshan•2mo ago
Thanks

Did you find this page helpful?