react-native-nitro-auth 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.1 - 2026-05-21
4
+
5
+ ### Changed
6
+
7
+ - Updated the package and Expo example baseline to Expo SDK 56, React Native 0.85.3, React 19.2.3, TypeScript 6.0.3, Nitro Modules 0.35.7, and nitrogen 0.35.7.
8
+ - Raised the iOS deployment target to 16.4 for SDK 56 compatibility.
9
+ - Added release preflight checks for Expo dependency validation, Expo Doctor, config introspection, package build, tests, C++ tests, and publish dry run.
10
+ - Simplified the example app by keeping provider-specific advanced options collapsed by default.
11
+ - Updated README badges, setup commands, release checks, and typed API examples to match the 0.6.1 package state.
12
+ - Added compile-time coverage for provider-specific login option types.
13
+ - Added CI setup and versioned tool detection for LLVM C++ coverage tools.
14
+ - Added a CI-safe release preflight mode that skips unauthenticated npm publish dry runs while keeping local publish dry runs intact.
15
+
16
+ ### Fixed
17
+
18
+ - Retained the active iOS Apple Sign-In controller until completion to avoid premature native lifecycle cleanup.
19
+ - Removed the example app's import-time native logging side effect.
20
+ - Removed Turbo cache-output warnings from lint and typecheck tasks.
21
+
3
22
  ## 0.6.0 - 2026-05-14
4
23
 
5
24
  ### Added
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # react-native-nitro-auth
2
2
 
3
- ![npm](https://img.shields.io/badge/npm-v0.6.0-f97316?style=flat-square)
4
- ![license](https://img.shields.io/badge/license-MIT-007ec6?style=flat-square)
5
- ![react-native](https://img.shields.io/badge/react--native-%3E%3D0.75-61dafb?style=flat-square)
6
- ![nitro-modules](https://img.shields.io/badge/nitro--modules-%3E%3D0.35.0-black?style=flat-square)
3
+ [![npm](https://img.shields.io/badge/npm-v0.6.1-f97316?style=flat-square)](https://www.npmjs.com/package/react-native-nitro-auth)
4
+ [![license](https://img.shields.io/badge/license-MIT-007ec6?style=flat-square)](https://github.com/JoaoPauloCMarra/react-native-nitro-auth/blob/main/LICENSE)
5
+ [![react-native](https://img.shields.io/badge/react--native-%3E%3D0.75-61dafb?style=flat-square)](https://reactnative.dev/)
6
+ [![nitro-modules](https://img.shields.io/badge/nitro--modules-%3E%3D0.35.0-black?style=flat-square)](https://nitro.margelo.com/)
7
7
 
8
8
  Fast React Native authentication for Google Sign-In, Apple Sign-In, and Microsoft Entra ID, built on Nitro Modules and JSI.
9
9
 
@@ -41,6 +41,8 @@ For Expo projects, prebuild after adding the config plugin:
41
41
  bunx expo prebuild --clean
42
42
  ```
43
43
 
44
+ The example app uses Expo Continuous Native Generation. Its `apps/example/android` and `apps/example/ios` folders are generated local artifacts and intentionally ignored by git.
45
+
44
46
  For bare React Native projects, install pods after installing the package:
45
47
 
46
48
  ```sh
@@ -49,13 +51,15 @@ cd ios && pod install
49
51
 
50
52
  ## Requirements
51
53
 
52
- | Runtime | Requirement |
53
- | --------------------- | ---------------------------------------- |
54
- | React Native | `>=0.75` |
55
- | Nitro Modules | `>=0.35` |
56
- | iOS | 15.1+ recommended |
57
- | Android | min SDK 24+ recommended |
58
- | Expo example baseline | Expo SDK 55, React Native 0.83, React 19 |
54
+ | Runtime | Requirement |
55
+ | ------------------ | ---------------------------------------- |
56
+ | React Native | `>=0.75` peer range |
57
+ | Nitro Modules | `>=0.35` peer range |
58
+ | iOS | 16.4+ for Expo SDK 56 |
59
+ | Android | min SDK 24+ recommended |
60
+ | Validated baseline | Expo SDK 56, React Native 0.85, React 19 |
61
+
62
+ The package keeps a wide React Native peer range for existing consumers, but this release is validated against Expo SDK 56, React Native 0.85.3, React 19.2.3, and Nitro Modules 0.35.7.
59
63
 
60
64
  ## Expo Setup
61
65
 
@@ -154,16 +158,23 @@ Use `microsoftTenant` for `common`, `organizations`, `consumers`, a tenant ID, o
154
158
 
155
159
  ```tsx
156
160
  import { Button, Text, View } from "react-native";
157
- import { AuthError, useAuth } from "react-native-nitro-auth";
161
+ import {
162
+ AuthError,
163
+ type GoogleLoginOptions,
164
+ useAuth,
165
+ } from "react-native-nitro-auth";
166
+
167
+ const googleOptions = {
168
+ scopes: ["email", "profile"],
169
+ forceAccountPicker: true,
170
+ } satisfies GoogleLoginOptions;
158
171
 
159
172
  export function SignInScreen() {
160
173
  const { user, loading, login, logout, getAccessToken } = useAuth();
161
174
 
162
175
  async function signInWithGoogle() {
163
176
  try {
164
- await login("google", {
165
- scopes: ["email", "profile"],
166
- });
177
+ await login("google", googleOptions);
167
178
  } catch (e) {
168
179
  const error = AuthError.from(e);
169
180
  console.warn(error.code, error.underlyingMessage);
@@ -408,7 +419,7 @@ type UseAuthReturn = {
408
419
 
409
420
  ### Strong Login Types
410
421
 
411
- `AuthService.login()` and `useAuth().login()` infer the allowed option object from the provider argument.
422
+ `AuthService.login()` and `useAuth().login()` infer the allowed option object from the provider argument. Provider-specific option types intentionally reject unsupported keys, so TypeScript can catch mistakes before they become native configuration bugs.
412
423
 
413
424
  ```ts
414
425
  await AuthService.login("apple", {
@@ -447,6 +458,18 @@ const microsoftOptions = {
447
458
  } satisfies MicrosoftLoginOptions;
448
459
  ```
449
460
 
461
+ Examples of mistakes that TypeScript rejects:
462
+
463
+ ```ts
464
+ await AuthService.login("apple", {
465
+ tenant: "organizations",
466
+ });
467
+
468
+ await AuthService.login("microsoft", {
469
+ nonce: "opaque-nonce",
470
+ });
471
+ ```
472
+
450
473
  ### AuthUser
451
474
 
452
475
  ```ts
@@ -476,9 +499,9 @@ The example app is the fastest way to verify setup and read a complete integrati
476
499
  ```sh
477
500
  cp apps/example/.env.example apps/example/.env.local
478
501
  bun install
479
- bun example:prebuild:clean
480
- bun example:ios
481
- bun example:android
502
+ bun run example:prebuild:clean
503
+ bun run example:ios
504
+ bun run example:android
482
505
  ```
483
506
 
484
507
  The demo includes:
@@ -514,10 +537,12 @@ The demo includes:
514
537
  ## Release Checks
515
538
 
516
539
  ```sh
517
- bun run publish-package:dry-run
540
+ bun run release:preflight
518
541
  ```
519
542
 
520
- The publish script runs frozen install, core-version verification, codegen, build, lint, typecheck, Jest, JS coverage, C++ tests, C++ coverage, Expo Doctor, package docs sync, pack dry run, and `bun publish --dry-run --ignore-scripts`.
543
+ The release preflight runs core-version verification, codegen, build, lint, typecheck, Jest, C++ tests, Expo dependency validation, Expo Doctor, Expo config introspection, package docs sync, pack dry run, and `bun publish --dry-run --ignore-scripts`.
544
+
545
+ CI runs the same preflight with registry publish dry-run disabled because GitHub pull-request jobs do not have npm publish credentials.
521
546
 
522
547
  For faster local iteration before the full release dry run:
523
548
 
@@ -11,6 +11,7 @@ public class AuthAdapter: NSObject {
11
11
  private static var inMemoryMicrosoftScopes: [String] = defaultMicrosoftScopes
12
12
  private static var inMemoryGoogleServerAuthCode: String?
13
13
  private static var activeMicrosoftWebAuthSession: ASWebAuthenticationSession?
14
+ private static var activeAppleSignInController: ASAuthorizationController?
14
15
  private static let tokenStoreLock = NSLock()
15
16
  private static let interactiveAuthLock = NSLock()
16
17
  private static var interactiveAuthInProgress = false
@@ -26,6 +27,7 @@ public class AuthAdapter: NSObject {
26
27
  }
27
28
 
28
29
  private static func finishInteractiveAuth() {
30
+ activeAppleSignInController = nil
29
31
  interactiveAuthLock.lock()
30
32
  interactiveAuthInProgress = false
31
33
  interactiveAuthLock.unlock()
@@ -104,6 +106,7 @@ public class AuthAdapter: NSObject {
104
106
  let controller = ASAuthorizationController(authorizationRequests: [request])
105
107
  let delegate = AppleSignInDelegate(completion: complete)
106
108
  controller.delegate = delegate
109
+ activeAppleSignInController = controller
107
110
  objc_setAssociatedObject(controller, &delegateHandle, delegate, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
108
111
 
109
112
  DispatchQueue.main.async {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-auth",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "High-performance authentication library for React Native with Google Sign-In, Apple Sign-In, and Microsoft Sign-In support, powered by Nitro Modules (JSI)",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -84,16 +84,16 @@
84
84
  "access": "public"
85
85
  },
86
86
  "devDependencies": {
87
- "@expo/config-plugins": "^55.0.8",
88
- "@react-native/babel-preset": "^0.83.6",
87
+ "@expo/config-plugins": "^56.0.7",
88
+ "@react-native/babel-preset": "^0.85.3",
89
89
  "@testing-library/react": "^16.3.2",
90
90
  "@types/node": "^22.19.17",
91
91
  "jest-environment-jsdom": "^29.7.0",
92
- "react": "19.2.0",
93
- "react-native": "0.83.6",
94
- "react-native-nitro-modules": "^0.35.6",
92
+ "react": "19.2.3",
93
+ "react-native": "0.85.3",
94
+ "react-native-nitro-modules": "^0.35.7",
95
95
  "react-native-web": "^0.21.2",
96
- "typescript": "^5.9.3"
96
+ "typescript": "^6.0.3"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "react": "*",
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
10
10
  s.license = package["license"]
11
11
  s.authors = package["author"]
12
12
 
13
- s.platforms = { :ios => "15.1" }
13
+ s.platforms = { :ios => "16.4" }
14
14
  s.source = { :git => "https://github.com/JoaoPauloCMarra/react-native-nitro-auth.git", :tag => "#{s.version}" }
15
15
 
16
16
  s.swift_version = "5.9"