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

# SDK

## Maven Dependency

```xml
<dependency>
    <groupId>com.azlicense</groupId>
    <artifactId>azlicense-sdk</artifactId>
    <version>1.0.0</version>
</dependency>
```

## Basic Usage

```java
LicenseClient client = new LicenseClient("https://yourhostingurl.com", publicKey);

LicenseResult result = client.verify(
    getConfig().getString("license"),
    "MyPlugin",
    "1.0.0"
);

if (!result.isValid()) {
    getLogger().severe(result.getReason());
    getServer().getPluginManager().disablePlugin(this);
}
```

## Offline Verification

The SDK automatically caches signed offline tokens to disk. If the API is unreachable, the cached token is verified using ECDSA signature verification. The default grace period is **72 hours** from issuance.

## Periodic Verification

```java
client.startPeriodicVerification(
    licenseKey,
    pluginName,
    pluginVersion,
    30, // minutes
    result -> {
        getLogger().severe("Verification failed: " + result.getReason());
        disablePlugin();
    }
);
```

## API Reference

| Method                                                                 | Description                                 |
| ---------------------------------------------------------------------- | ------------------------------------------- |
| `verify(key, name, version)`                                           | Quick verify with auto-detected server UUID |
| `verify(key, name, version, uuid, ip, port)`                           | Full verification with server details       |
| `getLastResult()`                                                      | Get the last cached verification result     |
| `startPeriodicVerification(key, name, version, intervalMin, callback)` | Start periodic re-verification              |
| `shutdown()`                                                           | Clean up scheduler resources                |

## Building

```bash
cd sdk-java
mvn clean install
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://azlicense.gitbook.io/azlicense-docs/sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
