Skip to main content

Function: getGenericPassword()

getGenericPassword(serviceOrOptions?): Promise<false | UserCredentials>

Fetches the username and password combination for the given service.

Parameters

serviceOrOptions?: string | Partial<object & BaseOptions>

A keychain options object or a service name string.

Returns

Promise<false | UserCredentials>

Resolves to an object containing service, username, password, and storage when successful, or false on failure.

Example

const credentials = await Keychain.getGenericPassword();
if (credentials) {
console.log('Credentials successfully loaded for user ' + credentials.username);
} else {
console.log('No credentials stored');
}

Defined in

index.ts:283