Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@gustash/react-native-smart-lock
Advanced tools
Readme
This package exposes Google Smart Lock for auto sign-in based on saved credentials.
$ npm install @gustash/react-native-smart-lock --save
$ react-native link @gustash/react-native-smart-lock
import SmartLock from '@gustash/react-native-smart-lock';
async function request() {
// You can also send a client server id as a paramenter as well
// const {error, success, ...credentials} = await SmartLock.request('some.server.id');
const {error, success, ...credentials} = await SmartLock.request();
if (error) {
console.error(error);
return;
}
if (success) {
// Account found. Do something with credentials.
const {
id,
password,
accountType,
familyName,
givenName,
name,
profilePictureUri,
idTokens,
} = credentials;
}
}
import SmartLock from '@gustash/react-native-smart-lock';
async function save() {
const credentials = {
id: 'some@email.com',
profilePictureUri:
'https://api.adorable.io/avatars/285/abott@adorable.png',
name: 'John Doe',
password: 'password',
};
const error = await SmartLock.save(credentials);
// The save method might be canceled if the system wants to give priority
// to the password manager UI instead.
if (error && error !== 'canceled') {
console.error(error);
}
}
import SmartLock from '@gustash/react-native-smart-lock';
async function deleteCredential() {
const error = await SmartLock.delete('some@email.com');
if (error) {
console.error(error);
}
}
import SmartLock from '@gustash/react-native-smart-lock';
// This disables request() until a new save() is called.
// You should call this on logout to allow the user to change accounts, for example.
SmartLock.disableAutoSignIn();
FAQs
Google Smart Lock for React Native
The npm package @gustash/react-native-smart-lock receives a total of 12 weekly downloads. As such, @gustash/react-native-smart-lock popularity was classified as not popular.
We found that @gustash/react-native-smart-lock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.