Skip to content

Conversation

Off2Race
Copy link

Description

Added an Expo config plugin so that react-native-app-auth can be used in an Expo 53-based project using CNG (Continuous Native Generation).

NOTE: The plugin will detect the current Expo version and should work with versions prior to 53 but that use case is not well-tested. For best results, stick with Expo 53.

Thanks to @aurelian for the original version that led to this.

Steps to verify

STEP 1
Add the plugin to the app's app.config.ts. See example below.

import { ConfigContext, ExpoConfig } from '@expo/config';
import withAppAuth from 'react-native-app-auth/plugin';

require('ts-node/register');

export default ({ config }: ConfigContext): Partial<ExpoConfig> => {
	const existingPlugins = config.plugins ?? [];

	return {
		...config,

		plugins: [
			...existingPlugins,
			[
				withAppAuth,
				{
					ios: {
						urlScheme: 'my-url-scheme-goes-here',
					},
					android: {
						appAuthRedirectScheme: 'my-redirect-scheme-goes-here',
					},
				},
			],
		] as ExpoConfig['plugins'],
	};
};

STEP 2
You'll likely need to add a react-native-app-auth.d.ts to the folder where you keep your Typescript types:

declare module 'react-native-app-auth/plugin' {
	const withAppAuth: any;
	export default withAppAuth;
}

STEP 3
Run npx expo prebuild --clean

Copy link

changeset-bot bot commented Aug 18, 2025

⚠️ No Changeset found

Latest commit: 7393dea

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Aug 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
react-native-app-auth Ready Ready Preview Comment Aug 22, 2025 3:14pm

@Off2Race
Copy link
Author

Hi, @zibs – Not sure what else you want/need with regard to testing and documentation for this. Do you want me to add something to the README which explains how to configure the plugin (similar to the notes above)? Let me know and I'll be happy to do whatever you need.

@zibs zibs self-requested a review August 18, 2025 20:15
@zibs zibs self-assigned this Aug 18, 2025
@zibs
Copy link
Contributor

zibs commented Aug 18, 2025

Thanks so much @Off2Race -- I'll take a look and be sure to let you know!

zibs added 8 commits August 18, 2025 14:46
- Add app.plugin.js entry point for Expo plugin discoverability
- Fix plugin configuration transform to handle redirectUrls properly
- Include plugin directory and entry point in npm package files
- Ensure iOS and Android URL schemes are configured correctly from redirectUrls array
- having some issues with the expo-cng demo app and the workspace, so we remove it from the workspace entirely right now so it manages its own deps.
@zibs
Copy link
Contributor

zibs commented Aug 25, 2025

Thanks @Off2Race -- I've updated the code to use TypeScript and added an example app that supports this flow, as well as added the docs. Feel free to take a look and a double check that it looks okay, and if so, we can look towards merging and releasing!! Really appreciate everything you've done here.

@Off2Race
Copy link
Author

Off2Race commented Aug 27, 2025

Awesome, @zibs! I'll look at it today. I should have realized that you'd want it in Typescript. My bad. Thanks for updating it. Back soon with feedback.

@zibs zibs requested a review from keithluchtel September 3, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants