# Getting Started

### How do I import the API?

To integrate the Wale API into your project, we recommend using Gradle or Maven. **Do not shade it**.

1. **First, you need to register the repository server by using the following URL:**

{% tabs %}
{% tab title="Gradle (Groovy)" %}

```gradle
maven {
    name "waleRepositoryReleases"
    url "https://repo.walecloud.com/releases"
}
```

{% endtab %}

{% tab title="Maven" %}

```xml
<repositories>
    <repository>
        <id>waleRepositoryReleases</id>
        <name>waleRepositoryReleases</name>
        <url>https://repo.walecloud.com/releases</url>
    </repository>
</repositories>
```

{% endtab %}
{% endtabs %}

2. **After that, add the dependency to your project.**

You can always check the latest version on the [repository server](https://repo.walecloud.com/#/releases/at/stefan/wale-api). For this documentation, version `1.5.8` is used.

{% tabs %}
{% tab title="Gradle (Groovy)" %}

```gradle
dependencies {
    compileOnly "at.stefan:wale-api:VERSION"
}
```

{% endtab %}

{% tab title="Maven" %}

```xml
<dependencies>
    <dependency>
        <groupId>at.stefan</groupId>
        <artifactId>wale-api</artifactId>
        <version>VERSION</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
```

{% endtab %}
{% endtabs %}

{% hint style="danger" %}
Important: **Do not** shade the API yourself; **depend** on the **Wale plugin**, which always includes the **latest** API version.
{% endhint %}

### How do I now use the API in my project?

{% hint style="warning" %}
Create **only one instance** per plugin. If you have multiple plugins using the API, try to create only one instance and centralize it, as it can **save** on **traffic**.
{% endhint %}

```java
// An example of how to initialize the API
public class Test extends JavaPlugin {
    
    @Getter
    private WaleAPI waleAPI;
    
    @Override
    public void onEnable() {
        waleAPI = new WaleAPI();
    }
}
```
