Skip to content

chore: Update to use new signIn function#6

Merged
sidorchukandrew merged 4 commits into
mainfrom
as/auth-updates
Nov 18, 2025
Merged

chore: Update to use new signIn function#6
sidorchukandrew merged 4 commits into
mainfrom
as/auth-updates

Conversation

@sidorchukandrew

Copy link
Copy Markdown
Collaborator

This includes a change to what we pass to the function as well as what gets returned. The 2 permissions arrays is now just 1 array. The returned object also contains extra fields about the user.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the signIn function to use a new API that simplifies the authentication flow by consolidating permissions into a single array and enriching the response with additional user information.

  • Simplified signIn function signature from two permission arrays (required/optional) to a single permissions array
  • Renamed YouVersionLoginResult to SignInWithYouVersionResult and made all fields optional
  • Added new user fields to the sign-in result: expiryDate, refreshToken, name, profilePicture, and email

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/types.ts Renamed result type and added optional user fields (expiryDate, refreshToken, name, profilePicture, email)
src/native.ts Updated native module signature to accept single permissions array
src/api/users.ts Simplified API to accept single permissions parameter instead of object with required/optional fields
src/tests/RNYouVersionPlatform/native-test.native.ts Updated test to use new single-array API and use objectContaining matcher
mocks/RNYouVersionPlatform.ts Updated return type name to SignInWithYouVersionResult
ios/YVPAuthAPI.swift Updated Swift implementation to use single permissions set and map new user fields to response
ios/RNYouVersionPlatformModule.swift Updated module function signature to accept single permissions array
example/src/screens/ProfileScreen.tsx Updated example to use new API and improved error handling separation
README.md Updated documentation to reflect new API signature and return fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mocks/RNYouVersionPlatform.ts
Comment thread README.md Outdated

@mic-mart mic-mart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @sidorchukandrew !

Instead of requiredPermissions and optionalPermissions, we
will only support a simple array of permissions.
@sidorchukandrew sidorchukandrew merged commit 136578f into main Nov 18, 2025
1 check passed
@sidorchukandrew sidorchukandrew deleted the as/auth-updates branch November 18, 2025 15:03
jhampton pushed a commit that referenced this pull request Nov 20, 2025
## 0.7.0 (2025-11-20)

* feat(docs): update example app language for publishing release (#21) ([2abf72d](2abf72d)), closes [#21](#21)
* chore: Update to use new `signIn` function (#6) ([136578f](136578f)), closes [#6](#6)
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants