# 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)).

![](/files/-LssnsSWTRuypsluuADn)

## 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`](/fortmatic-native/configuration.md) 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'`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fortmatic.com/fortmatic-native/log-in.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
