SDKs

Auth.it provides SDKs for a variety of languages to help you build integrations more easily.

Auth.it’s SDKs make it easier to access the Admin API. Check out installation instructions for the TypeScript and Java SDKs below.

Official SDKs

TypeScript SDK

The TypeScript SDK can be used in both browser and server environments, enabling you to build full-stack applications with Auth.it.

Installation

To install the SDK from npm, run:

1npm i --save @auth-it/typescript

Server Usage

Most of your interactions with the Admin API will likely happen on the server, to protect API requests and user credentials. You’ll use the SDK in your frontend to let users connect accounts. Once connected, you’ll use the SDK on the server to find and update users, organizations, events, webhooks, and more.

1import { AuthItClient } from "@auth-it/typescript";
2
3// These secrets should be saved securely and passed to your environment
4const client = new AuthItClient({
5 clientId: "{client_id}",
6 clientSecret: "{client_secret}",
7 url: "{url}",
8 realm: "{realm}",
9});
10
11// The client provides methods to interact with the Admin API

Browser Usage

You’ll primarily use the browser client to let your users securely connect apps from your frontend. When making calls from the browser, you’ll use short-lived access tokens to authenticate requests.

1import { AuthItClient } from "@auth-it/typescript";
2
3const client = new AuthItClient({
4 token: "{token}",
5 url: "{url}",
6 realm: "{realm}",
7});

Java SDK

The Java SDK is for server-side use in JVM-based applications. Use it to build Java backends, Spring Boot applications, and other JVM services that integrate with Auth.it.

Installation

To install the SDK with Maven, add this dependency to your pom.xml:

1<dependency>
2 <groupId>it.auth</groupId>
3 <artifactId>authit-java</artifactId>
4 <version>1.0.0</version>
5</dependency>

For Gradle, add this to your build.gradle:

1implementation 'it.auth:authit-java:1.0.0'

Usage

The Java SDK is designed for server-side applications. Use it to securely manage user connections, retrieve account info, and interact with the Admin API from your Java backend.

1import it.auth.api.AuthItClient;
2
3// These secrets should be saved securely and passed to your environment
4AuthItClient client = AuthItClient
5 .builder()
6 .clientId("{client_id}")
7 .clientSecret("{client_secret}")
8 .url("{url}")
9 .realm("{realm}")
10 .build();
11
12// The client provides methods to interact with the Admin API

OpenAPI Specification

If you use another language, you can download our OpenAPI spec file and generate a client for your preferred language.

https://github.com/auth-it/authit-config/blob/main/fern/authit.yml

Request a new SDK

If you’d like to request an SDK for a language that we don’t currently support, let us know. We’re always looking to expand our SDK offerings and would love to hear from you.