Skip to content

getInternetCredentials() ​

ts
function getInternetCredentials(server, options?): Promise<false | InternetCredentials>

Fetches the internet credentials for the given server.

Parameters ​

• server: string

The server URL.

• options?: GetOptions

A keychain options object.

Returns ​

Promise<false | InternetCredentials>

Resolves to credentials containing server on iOS or service on Android, or false when no credentials are found.

Example ​

typescript
const credentials = await Keychain.getInternetCredentials('https://example.com');
if (credentials) {
  console.log('Credentials loaded for user ' + credentials.username);
} else {
  console.log('No credentials stored for server');
}

Defined in ​

index.ts:218