Getting Started with the 1D6 API
1D6 uses a small monolithic server as its backend, allowing for user logins and holding all the mods that 1D6 has to offer.
The source code can be viewed here.
Each language has it's own SDK, and as such the documentation and inner workings for each of them is slightly different.
Below you can choose what language you want to use and it will carry across the whole page.
Installing
- Java (Gradle)
- Kotlin (Gradle)
- Scala (SBT)
- C# (NuGet)
- Javascript (NPM)
- Raw HTTP (CUrl)
- Gradle
- Gradle.kts
You can grab the .jar from Jitpack.
Add this to your build.gradle
file.
plugins {
id 'application' // assuming you don't already have it
}
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'com.github.OneDSix:1d6-api:main-SNAPSHOT'
}
You can grab the .jar from Jitpack.
Add this to your build.gradle.kts
file.
plugins {
id("application") // assuming you don't already have it
}
repositories {
maven { url = uri("https://jitpack.io") }
}
dependencies {
implementation("com.github.OneDSix:1d6-api:main-SNAPSHOT")
}
- Gradle
- Gradle.kts
You can grab the .jar from Jitpack.
Add this to your build.gradle
file.
plugins {
id 'application' // assuming you don't already have it
}
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'com.github.OneDSix:1d6-api:main-SNAPSHOT'
}
You can grab the .jar from Jitpack.
Add this to your build.gradle.kts
file.
plugins {
id("application") // assuming you don't already have it
}
repositories {
maven { url = uri("https://jitpack.io") }
}
dependencies {
implementation("com.github.OneDSix:1d6-api:main-SNAPSHOT")
}
You can grab the .jar from Jitpack.
Add this to your build.sbt
file.
resolvers += "jitpack" at "https://jitpack.io"
libraryDependencies += "com.github.OneDSix" % "1d6-api" % "main-SNAPSHOT"
This SDK isn't as documented or maintained as the others, as its only used in the Playnite plugin.
If you have the option, please use the JVM, JS, or any Community Maintained SDKs instead.
If you know C# and want to document, improve, or maintain this SDK, you know where to find us.
TODO
This is not the JS Modding SDK, this is for interacting with the 1D6 API via Javascript.
While they are compatible, this package even being included inside the Modding SDK, they are not the same thing.
If you're looking for the modding SDK, click here.
- NPM
- Yarn
As of right now the package has not been posted to NPM yet.
For now, just import straight from the repo, we will notify you went it has been posted, but this should continue to work even after the NPM package has been released.
npm install --save OneDSix/1d6-api#jsdk
As of right now the package has not been posted to NPM yet.
For now, just import straight from the repo, we will notify you went it has been posted, but this should continue to work even after the NPM package has been released.
yarn add OneDSix/1d6-api#jsdk
If you want to target Browsers, here is a Webpack config that should work in most environments. You may need to edit it slightly to correct the directory names.
const path = require('path');
module.exports = {
entry: './src/main.ts',
mode: "development",
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/,
}
],
},
resolve: {
extensions: ['.ts', '.js'],
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
};
Don't forget to install the needed dependencies for webpack!
- NPM
- Yarn
npm install webpack webpack-cli ts-loader --save-dev
yarn add webpack webpack-cli ts-loader
No installs are needed, just make sure you have CUrl installed on your system using this command.
curl -V
This section will use CUrl, but you can easily use another HTTP client, even a browser if you like.
Logging In
In order to access most services on the API, you need to log in via a 1D6 account first.
Thankfully, its just a simple username-password combo. This will be changed later, but for right now this how you log in.
- Java (Gradle)
- Kotlin (Gradle)
- Scala (SBT)
- C# (NuGet)
- Javascript (NPM)
- Raw HTTP (CUrl)
TODO
TODO
TODO
TODO
TODO
TODO