🚀 Socket Launch Week 🚀 Day 3: Socket Acquires Coana.Learn More

@invertase/react-native-apple-authentication

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
r

@invertase/react-native-apple-authentication

A complete Apple Authentication services API for React Native iOS apps.

2.4.1
latest
100

Supply Chain Security

100

Vulnerability

100

Quality

88

Maintenance

100

License

Version published
Weekly downloads
176K
-24.96%
Maintainers
5
Weekly downloads
 
Created
Issues
12

What is @invertase/react-native-apple-authentication?

@invertase/react-native-apple-authentication is a React Native library that provides support for Apple Authentication on iOS devices. It allows developers to integrate Sign in with Apple functionality into their React Native applications, enabling users to sign in using their Apple ID.

What are @invertase/react-native-apple-authentication's main functionalities?

Sign in with Apple

This feature allows users to sign in with their Apple ID. The code sample demonstrates how to initiate the sign-in request, handle the response, and use the identity token to authenticate with Firebase.

import { appleAuth } from '@invertase/react-native-apple-authentication';

async function onAppleButtonPress() {
  // Start the sign-in request
  const appleAuthRequestResponse = await appleAuth.performRequest({
    requestedOperation: appleAuth.Operation.LOGIN,
    requestedScopes: [appleAuth.Scope.EMAIL, appleAuth.Scope.FULL_NAME],
  });

  // Ensure Apple returned a user identityToken
  if (!appleAuthRequestResponse.identityToken) {
    throw 'Apple Sign-In failed - no identify token returned';
  }

  // Create a Firebase credential with the token
  const { identityToken, nonce } = appleAuthRequestResponse;
  const appleCredential = firebase.auth.AppleAuthProvider.credential(identityToken, nonce);

  // Sign the user in with the credential
  return firebase.auth().signInWithCredential(appleCredential);
}

Check Credential State

This feature allows developers to check the credential state of a user. The code sample shows how to check if a user is still authorized.

import { appleAuth } from '@invertase/react-native-apple-authentication';

async function checkCredentialState(user) {
  const credentialState = await appleAuth.getCredentialStateForUser(user);
  if (credentialState === appleAuth.State.AUTHORIZED) {
    // User is authorized
  } else {
    // User is not authorized
  }
}

Other packages similar to @invertase/react-native-apple-authentication

FAQs

Package last updated on 03 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts