Skip to content

setGenericPassword() ​

ts
function setGenericPassword(
   username, 
   password, 
options?): Promise<false | Result>

Saves the username and password combination for the given service.

Parameters ​

• username: string

The username or e-mail to be saved.

• password: string

The password to be saved.

• options?: SetOptions

A keychain options object.

Returns ​

Promise<false | Result>

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

Example ​

typescript
await Keychain.setGenericPassword('username', 'password');

Defined in ​

index.ts:41