Kotlin SDK
The Permit.io Kotlin SDK is a client for the Permit API, generated from the Permit OpenAPI specification with OpenAPI Generator. This page is for Kotlin developers who want to manage Permit objects, such as users, tenants, and roles, from Kotlin. The page covers what the repository contains, how to build the client library, and which SDK to use for permission checks.
What the Kotlin SDK covers
The generated client calls the Permit API at https://api.permit.io, which manages policy and data objects. The client has no check() helper and no policy decision point (PDP) client, so it doesn't run permission checks.
For permission checks from Kotlin on the JVM, use the Java SDK, which runs in Kotlin code and implements permit.check(). See Check permissions with the Java SDK.
The Kotlin SDK is not included in the SDK feature parity table, which covers the SDKs that implement permit.check().
Get the Kotlin SDK
The generated API classes, model classes, and their reference documentation are in the permitio/permit-kotlin repository on GitHub. Each API class covers one group of endpoints, for example UsersApi and TenantsApi, and the docs directory documents every class and method.
For the versions of Kotlin and Gradle the project is built with, see the Requires section of the permit-kotlin README.
Build the Kotlin SDK
The repository holds a Gradle project with a committed Gradle wrapper. Clone the repository and run the wrapper:
git clone https://github.com/permitio/permit-kotlin.git
cd permit-kotlin
./gradlew check assemble
The build succeeds when Gradle prints BUILD SUCCESSFUL and writes a JAR into build/libs. Add that JAR to your project, and authenticate calls with your environment API key as the Documentation for Authorization section of the permit-kotlin README describes.
Get help with the Kotlin SDK
Ask questions and send feedback in the Permit.io Slack community.
Related pages
- Get your API key
- Permit API reference
- Check permissions with the Java SDK, which you can call from Kotlin on the JVM