> For the complete documentation index, see [llms.txt](https://impoo.gitbook.io/authenticationsystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://impoo.gitbook.io/authenticationsystem/developers/installation.md).

# Installation

Add AuthSystem as a dependency to your project. Choose your build tool below.

{% tabs %}
{% tab title="Gradle (Kotlin DSL)" %}

```kotlin
// build.gradle.kts
repositories {
    mavenCentral()
    maven("https://repo.papermc.io/repository/maven-public/")
    maven("https://repo.dynous.dev/")
}

dependencies {
    compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
    compileOnly("me.authsystem:authsystem-api:1.0.0")
}
```

{% endtab %}

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

```groovy
// build.gradle
repositories {
    mavenCentral()
    maven { url 'https://repo.papermc.io/repository/maven-public/' }
    maven { url 'https://repo.dynous.dev/' }
}

dependencies {
    compileOnly 'io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT'
    compileOnly 'me.authsystem:authsystem-api:1.0.0'
}
```

{% endtab %}

{% tab title="Maven" %}

```xml
<!-- pom.xml -->
<repositories>
    <repository>
        <id>papermc</id>
        <url>https://repo.papermc.io/repository/maven-public/</url>
    </repository>
    <repository>
        <id>dynous</id>
        <url>https://repo.dynous.dev/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>io.papermc.paper</groupId>
        <artifactId>paper-api</artifactId>
        <version>1.21.8-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>me.authsystem</groupId>
        <artifactId>authsystem-api</artifactId>
        <version>1.0.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
```

{% endtab %}
{% endtabs %}

## Soft dependency

Add AuthSystem as a soft dependency in your `plugin.yml`:

```yaml
name: YourPlugin
version: '1.0.0'
main: com.example.YourPlugin
api-version: '1.21'
softdepend:
  - AuthSystem
```

This ensures your plugin loads even if AuthSystem is not installed.

## Relocating the API

If you want to shade the AuthSystem API into your plugin (so users don't need AuthSystem installed to run your plugin, but it integrates when present), use a relocation:

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

```kotlin
dependencies {
    implementation("me.authsystem:authsystem-api:1.0.0")
}

tasks.named<com.github.johnrengelman.shadow.ShadowPlugin>("shadowJar") {
    relocate("me.authsystem.api", "your.package.shaded.authsystem.api")
}
```

{% endtab %}

{% tab title="Maven (shade)" %}

```xml
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <configuration>
        <relocations>
            <relocation>
                <pattern>me.authsystem.api</pattern>
                <shadedPattern>your.package.shaded.authsystem.api</shadedPattern>
            </relocation>
        </relocations>
    </configuration>
</plugin>
```

{% endtab %}
{% endtabs %}

***

> :bulb: **Tip**: Use `compileOnly` / `provided` scope so the API is not bundled with your plugin unless you explicitly shade it.
