# Log In

The Fortmatic SDK offers it's own end point for logging users into their Fortmatic wallets.

```javascript
// Initialize provider
import Fortmatic from 'fortmatic';
import Web3 from 'web3';

const fm = new Fortmatic('YOUR_API_KEY');
window.web3 = new Web3(fm.getProvider());

fm.user.login().then(() => {
  web3.eth.getAccounts().then(console.log); // ['0x...']
});
```

Users will be prompted with a Fortmatic login dialog, after which their wallet information will be returned to the SDK (similar to [Get User Account](https://developers.fortmatic.com/docs/get-user-account)).

![](https://2455634949-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lj7HukBJLlR6jbx0-eP%2F-LssmGz2Wzitv8xlPIxL%2F-LssnsSWTRuypsluuADn%2Flogin%402x.png?alt=media\&token=727a7a3d-bd76-400e-b302-625160ccc4cb)

## Customizing Login Behavior

Users have the optionality to log in with email *or* password and developers can customize which option takes precedence using the [`Fortmatic.configure`](https://docs.fortmatic.com/v1.x/fortmatic-native/configuration) method, like so:

```javascript
// Initialize provider
import Fortmatic from 'fortmatic';
import Web3 from 'web3';

const fm = new Fortmatic('YOUR_API_KEY');
window.web3 = new Web3(fm.getProvider());

fm.configure({ primaryLoginOption: 'email' }).then(() => {
  fm.user.login().then(() => {
    web3.eth.getAccounts().then(console.log); // ['0x...']
  });
});

```

Currently the following options are supported for `primaryLoginOption`:

* `'email'`
* `'phone'`
