> For the complete documentation index, see [llms.txt](https://openifood.gitbook.io/open-ifood-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openifood.gitbook.io/open-ifood-sdk/getting-started-guide.md).

# Getting Started Guide

For a initial interation with the SDK, follow this guide.

### 1. Installing

Add the SDK dependency on your **pom.xml** or **build.gradle, c**heck the latest version at [Maven Central Repository](https://central.sonatype.com/artifact/io.github.open-ifood/sdk).

#### Maven

```xml
<dependency>
    <groupId>io.github.open-ifood</groupId>
    <artifactId>sdk</artifactId>
    <version>1.0.0</version>
</dependency>
```

#### Gradle

```kotlin
implementation 'io.github.open-ifood:sdk:1.0.0'
```

### 2. Initialize the authentication

Firstly, for use private modules (address, order and merchants) you will need authenticate with a valid account.

Use the **IFoodService** class for create a new entry class instance and request auth code.

```java
IFoodService
        .initialize()
        .authenticate(
                EmailAuthenticationRequest.builder()
                        .tenantId("IFO")
                        .type("EMAIL")
                        .email("email@domain.com")
                        .build()
)
```

### 3. Confirm auth code

Then, with the code at last step, you will receive an 6-digit authorization code in your e-mail, after receiving confirm this by running the following code snippet.

```java
UserSession session = session.confirm("515151")
```

### 4. Access to private modules

So authenticated =). If any issues occurred during authentication process, through received **UserSession** you will be able to use private modules.

<pre class="language-java"><code class="lang-java">// list user addresses
session.address()
    .list()
 
// list merchants by filter
session.merchant()
    .list(
        MerchantFilter.builder()
            .coordinate(
                    Coordinate.builder()
                            .longitude("-22.5155151")
                            .latitude("-51.12313123")
                            .build()
            )
            .sort("user_rating:desc")
            .size(20)
            .build()
<strong>    );
</strong></code></pre>

Above you can see two code samples using private modules, check the [Documentation](/open-ifood-sdk/documentation.md) to learn more and get detailed module information.
