Official SDKs for Authdog authentication and user management platform.
- Python SDK - Python SDK for Authdog
- Node.js SDK - Node.js/TypeScript SDK for Authdog
- Go SDK - Go SDK for Authdog
- Rust SDK - Rust SDK for Authdog
- Java SDK - Java SDK for Authdog
- C# SDK - C# SDK for Authdog
- Kotlin SDK - Kotlin SDK for Authdog
- PHP SDK - PHP SDK for Authdog
- C++ SDK - C++ SDK for Authdog
- Elixir SDK - Elixir SDK for Authdog
- Scala SDK - Scala SDK for Authdog
- Swift SDK - Swift SDK for Authdog
- Zig SDK - Zig SDK for Authdog
- Common Lisp SDK - Common Lisp SDK for Authdog
- Clojure SDK - Clojure SDK for Authdog
- F# SDK - F# SDK for Authdog
- OCaml SDK - OCaml SDK for Authdog
- PowerShell SDK - PowerShell SDK for Authdog
- Dart SDK - Dart SDK for Authdog
from authdog import AuthdogClient
# Initialize the client
client = AuthdogClient("https://api.authdog.com")
# Get user information
user_info = client.get_userinfo("your-access-token")
print(f"User: {user_info['user']['displayName']}")
# Always close the client
client.close()import { AuthdogClient } from '@authdog/node-sdk';
// Initialize the client
const client = new AuthdogClient({
baseUrl: 'https://api.authdog.com'
});
// Get user information
const userInfo = await client.getUserInfo('your-access-token');
console.log(`User: ${userInfo.user.displayName}`);package main
import (
"context"
"fmt"
"log"
"github.com/authdog/go-sdk"
)
func main() {
// Initialize the client
client := authdog.NewClient(authdog.ClientConfig{
BaseURL: "https://api.authdog.com",
APIKey: "your-api-key", // Optional
})
// Get user information
ctx := context.Background()
userInfo, err := client.GetUserInfo(ctx, "your-access-token")
if err != nil {
log.Fatal(err)
}
fmt.Printf("User: %s\n", userInfo.User.DisplayName)
}import com.authdog.sdk.*
import kotlinx.coroutines.runBlocking
fun main() = runBlocking {
// Initialize the client
val client = AuthdogClient(
AuthdogClientConfig(
baseUrl = "https://api.authdog.com",
apiKey = "your-api-key" // Optional
)
)
// Get user information
val userInfo = client.getUserInfo("your-access-token")
println("User: ${userInfo.user.displayName}")
}use authdog::{AuthdogClient, AuthdogClientConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize the client
let config = AuthdogClientConfig {
base_url: "https://api.authdog.com".to_string(),
api_key: Some("your-api-key".to_string()), // Optional
..Default::default()
};
let client = AuthdogClient::new(config)?;
// Get user information
let user_info = client.get_user_info("your-access-token").await?;
println!("User: {}", user_info.user.display_name);
Ok(())
}<?php
require_once 'vendor/autoload.php';
use Authdog\AuthdogClient;
use Authdog\Exceptions\AuthenticationException;
use Authdog\Exceptions\ApiException;
// Initialize the client
$client = new AuthdogClient('https://api.authdog.com');
try {
// Get user information
$userInfo = $client->getUserInfo('your-access-token');
echo "User: " . $userInfo->user->displayName . "\n";
} catch (AuthenticationException $e) {
echo "Authentication failed: " . $e->getMessage() . "\n";
} catch (ApiException $e) {
echo "API error: " . $e->getMessage() . "\n";
}
// Always close the client
$client->close();using Authdog;
using Authdog.Exceptions;
// Initialize the client
var client = new AuthdogClient("https://api.authdog.com");
try
{
// Get user information
var userInfo = await client.GetUserInfoAsync("your-access-token");
Console.WriteLine($"User: {userInfo.User.DisplayName}");
}
catch (AuthenticationException ex)
{
Console.WriteLine($"Authentication failed: {ex.Message}");
}
catch (ApiException ex)
{
Console.WriteLine($"API error: {ex.Message}");
}
finally
{
// Always dispose the client
client.Dispose();
}#include <iostream>
#include "authdog/authdog_client.h"
#include "authdog/exceptions.h"
int main() {
try {
// Initialize the client
authdog::AuthdogClient client("https://api.authdog.com");
// Get user information
auto userInfo = client.getUserInfo("your-access-token");
std::cout << "User: " << userInfo.user.displayName << std::endl;
// Close the client
client.close();
} catch (const authdog::AuthenticationException& e) {
std::cerr << "Authentication failed: " << e.what() << std::endl;
} catch (const authdog::ApiException& e) {
std::cerr << "API error: " << e.what() << std::endl;
}
return 0;
}# Initialize the client
client = Authdog.Client.new("https://api.authdog.com")
# Get user information
case Authdog.Client.get_user_info(client, "your-access-token") do
{:ok, user_info} ->
IO.puts("User: #{user_info.user.display_name}")
{:error, :authentication_error, message} ->
IO.puts("Authentication failed: #{message}")
{:error, :api_error, message} ->
IO.puts("API error: #{message}")
endimport com.authdog.AuthdogClient;
import com.authdog.exceptions.AuthenticationException;
import com.authdog.exceptions.ApiException;
// Initialize the client
try (AuthdogClient client = new AuthdogClient("https://api.authdog.com")) {
// Get user information
UserInfoResponse userInfo = client.getUserInfo("your-access-token");
System.out.println("User: " + userInfo.getUser().getDisplayName());
} catch (AuthenticationException e) {
System.err.println("Authentication failed: " + e.getMessage());
} catch (ApiException e) {
System.err.println("API error: " + e.getMessage());
}import com.authdog.AuthdogClient
import com.authdog.exceptions.{AuthenticationException, ApiException}
// Initialize the client
val client = AuthdogClient("https://api.authdog.com")
try {
// Get user information
val userInfo = client.getUserInfo("your-access-token")
println(s"User: ${userInfo.user.displayName}")
} catch {
case e: AuthenticationException =>
println(s"Authentication failed: ${e.getMessage}")
case e: ApiException =>
println(s"API error: ${e.getMessage}")
} finally {
client.close()
}(ql:quickload :authdog)
(use-package :authdog)
;; Initialize the client
(defvar *client* (make-authdog-client "https://api.authdog.com"))
;; Get user information
(handler-case
(let ((user-info (get-user-info *client* "your-access-token")))
(format t "User: ~A~%" (user-display-name (user-info-response-user user-info))))
(authentication-error (e)
(format t "Authentication failed: ~A~%" (authdog-error-message e)))
(api-error (e)
(format t "API error: ~A~%" (authdog-error-message e))))(require '[authdog.core :as authdog]
'[authdog.exceptions :as ex])
;; Initialize the client
(def client (authdog/make-client "https://api.authdog.com"))
;; Get user information
(try
(let [user-info (authdog/get-user-info client "your-access-token")]
(println "User:" (:display-name (:user user-info))))
(catch clojure.lang.ExceptionInfo e
(cond
(ex/authentication-error? e)
(println "Authentication failed:" (.getMessage e))
(ex/api-error? e)
(println "API error:" (.getMessage e)))))import AuthdogSwiftSDK
// Initialize the client
let client = AuthdogClient(baseURL: "https://api.authdog.com")
// Get user information (async/await)
Task {
do {
let userInfo = try await client.getUserInfo(accessToken: "your-access-token")
print("User: \(userInfo.user.displayName)")
} catch AuthdogError.authenticationFailed(let message) {
print("Authentication failed: \(message)")
} catch AuthdogError.apiError(let message) {
print("API error: \(message)")
}
}
// Get user information (completion handler)
client.getUserInfo(accessToken: "your-access-token") { result in
switch result {
case .success(let userInfo):
print("User: \(userInfo.user.displayName)")
case .failure(let error):
print("Error: \(error.localizedDescription)")
}
}const authdog = @import("authdog");
// Initialize the client
var client = authdog.AuthdogClient.init("https://api.authdog.com", .{});
// Get user information
const user_info = client.getUserInfo("your-access-token") catch |err| switch (err) {
error.AuthenticationFailed => {
std.debug.print("Authentication failed\n", .{});
return;
},
error.ApiError => {
std.debug.print("API error\n", .{});
return;
},
else => {
std.debug.print("Unexpected error: {}\n", .{err});
return;
},
};
std.debug.print("User: {s}\n", .{user_info.user.display_name});These SDKs are also available with full documentation in their respective directories.
- User Information: Get detailed user information including profile data, emails, photos, and verification status
- Authentication: Handle authentication errors and token validation
- Type Safety: Full type support across all languages (TypeScript, Go, Kotlin, Rust)
- Error Handling: Structured error handling with specific exception types
- Modern APIs: Built with modern HTTP clients and async/await support
- Cross-Platform: Available for Python, Node.js, Go, Kotlin, Rust, PHP, C#, C++, Elixir, Java, Scala, Common Lisp, Clojure, Swift, Zig, and R
All SDKs support the following endpoint:
Retrieve user information using an access token.
Authentication: Bearer token required
Response Structure:
{
"meta": {
"code": 200,
"message": "Success"
},
"session": {
"remainingSeconds": 56229
},
"user": {
"id": "user-id",
"externalId": "external-id",
"userName": "username",
"displayName": "Display Name",
"emails": [{"value": "[email protected]", "type": null}],
"photos": [{"value": "https://example.com/photo.jpg", "type": "photo"}],
"names": {
"familyName": "Last",
"givenName": "First"
},
"verifications": [...],
"provider": "google-oauth20",
"environmentId": "env-id"
}
}All SDKs provide structured error handling:
AuthenticationError: Raised when authentication fails (401 responses)APIError: Raised when API requests fail- Base
AuthdogError: Common base class for all SDK errors
Each SDK has its own development setup. See the individual README files:
- Python SDK Development
- Node.js SDK Development
- Go SDK Development
- Kotlin SDK Development
- Rust SDK Development
- PHP SDK Development
- C# SDK Development
- C++ SDK Development
- Elixir SDK Development
- Java SDK Development
- Scala SDK Development
- Common Lisp SDK Development
- Clojure SDK Development
- Swift SDK Development
- Zig SDK Development
Please see our Contributing Guide for details on how to contribute to the SDKs.
MIT License - see LICENSE for details.