forked from public-mirrors/HuskSync
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.6 KiB
2.6 KiB
HuskSync API v2
The HuskSync API provides methods for retrieving and updating user data, as well as a number of events for tracking when user data is synced and saved.
The API is distributed via JitPack. Please note that the HuskSync v1 API is not compatible. (Some) javadocs are also available to view on Jitpack here.
Table of contents
- Adding the API to your project
- Adding HuskSync as a dependency
- Next steps
API Introduction
1.1 Setup with Maven
Maven setup information
- Add the repository to your
pom.xml
as per below.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
- Add the dependency to your
pom.xml
as per below. Replaceversion
with the latest version of HuskSync (without the v):
<dependency>
<groupId>net.william278</groupId>
<artifactId>HuskSync</artifactId>
<version>version</version>
<scope>provided</scope>
</dependency>
1.2 Setup with Gradle
Gradle setup information
- Add the dependency like so to your
build.gradle
:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
- Add the dependency as per below. Replace
version
with the latest version of HuskSync (without the v):
dependencies {
compileOnly 'net.william278:HuskSync:version'
}
2. Adding HuskSync as a dependency
- Add HuskSync to your
softdepend
(if you want to optionally use HuskSync) ordepend
(if your plugin relies on HuskSync) section inplugin.yml
of your project.
name: MyPlugin
version: 1.0
main: net.william278.myplugin.MyPlugin
author: William278
description: 'A plugin that hooks with the HuskSync API!'
softdepend: # Or, use 'depend' here
- HuskSync
3. Next steps
Now that you've got everything ready, you can start doing stuff with the HuskSync API!
- UserData API — Get data snapshots and update current user data
- API Events — Listen to, cancel and modify the result of data synchronization events