An SDK in your language
One AnyOAuth account covers all your apps. Create projects under that account, register their callback URLs, and reuse the same SDK integration across them. Project credentials work across available providers; AnyOAuth manages the provider app IDs and secrets.
Create your projectBackend SDKs
Mount the Node.js managed router for automatic callbacks and sessions, or use the two-method login flow in your backend language. Start with the simple SDK quickstart and current-source installation.
Mount in your existing Express app.
import { createAuth } from "@anyoauth/node/express";
const auth = createAuth({
clientId: process.env.ANYOAUTH_CLIENT_ID,
clientSecret: process.env.ANYOAUTH_CLIENT_SECRET,
origin: "http://localhost:3000",
});
app.use("/auth", auth.router());
npm install @anyoauth/nodeManaged backend routerCurrent source example · published 0.1.0 predates these helpers
Mount in your existing Hono app.
import { createAuth } from "@anyoauth/node/auth";
const auth = createAuth({
clientId: process.env.ANYOAUTH_CLIENT_ID,
clientSecret: process.env.ANYOAUTH_CLIENT_SECRET,
origin: "http://localhost:3000",
});
app.all("/auth/*", (c) => auth.handle(c.req.raw));
npm install @anyoauth/nodeManaged backend routerCurrent source example · published 0.1.0 predates these helpers
Mount in your existing Fastify app. The SDK’s Node HTTP middleware writes to the raw response; hijack() hands response ownership to it.
import { createAuth } from "@anyoauth/node/express";
const auth = createAuth({
clientId: process.env.ANYOAUTH_CLIENT_ID,
clientSecret: process.env.ANYOAUTH_CLIENT_SECRET,
origin: "http://localhost:3000",
});
const router = auth.router();
app.all("/auth/*", async (request, reply) => {
reply.hijack();
await router(request.raw, reply.raw);
});
npm install @anyoauth/nodeManaged backend routerCurrent source example · published 0.1.0 predates these helpers
Save in app/auth/[...route]/route.js.
import { createAuth } from "@anyoauth/node/auth";
const auth = createAuth({
clientId: process.env.ANYOAUTH_CLIENT_ID,
clientSecret: process.env.ANYOAUTH_CLIENT_SECRET,
origin: "http://localhost:3000",
});
// app/auth/[...route]/route.js
export const GET = auth.handle;
export const POST = auth.handle;
npm install @anyoauth/nodeManaged backend routerCurrent source example · published 0.1.0 predates these helpers
Save in src/pages/auth/[...route].js and configure an Astro server adapter.
import { createAuth } from "@anyoauth/node/auth";
const auth = createAuth({
clientId: process.env.ANYOAUTH_CLIENT_ID,
clientSecret: process.env.ANYOAUTH_CLIENT_SECRET,
origin: "http://localhost:3000",
});
// src/pages/auth/[...route].js (Astro with a server adapter)
export const prerender = false;
export const GET = ({ request }) => auth.handle(request);
export const POST = ({ request }) => auth.handle(request);
npm install @anyoauth/nodeManaged backend routerCurrent source example · published 0.1.0 predates these helpers
Run this module with Node.js 22 or newer. The SDK middleware serves the /auth routes.
import { createServer } from 'node:http';
import { createAuth } from "@anyoauth/node/express";
const auth = createAuth({
clientId: process.env.ANYOAUTH_CLIENT_ID,
clientSecret: process.env.ANYOAUTH_CLIENT_SECRET,
origin: "http://localhost:3000",
});
createServer(auth.router()).listen(3000);
npm install @anyoauth/nodeManaged backend routerCurrent source example · published 0.1.0 predates these helpers
Register this blueprint in your Flask app. Configure Flask-Session with a server-side store and HttpOnly, SameSite=Lax cookies; do not use Flask’s signed-cookie session for the private login attempt. Callback and session examples
import os
from flask import Blueprint, abort, current_app, jsonify, redirect, request, session
from anyoauth import Client, Error
auth = Blueprint("auth", __name__)
origin = "http://localhost:3000"
client = Client(os.environ["ANYOAUTH_CLIENT_ID"], os.environ["ANYOAUTH_CLIENT_SECRET"])
@auth.get("/login/<provider>")
def login(provider):
if provider not in ("google", "github"):
abort(400)
login = client.start_login({"provider": provider, "redirectUri": origin + "/auth/callback"})
session["pendingLogin"] = login["loginAttempt"]
return redirect(login["url"], 303)
@auth.get("/callback")
def callback():
if request.query_string or "pendingLogin" not in session:
abort(400)
attempt = session.pop("pendingLogin")
try:
result = client.complete_login({"loginAttempt": attempt})
except Error:
return jsonify(error="sign_in_failed"), 502
if result["status"] == "pending":
session["pendingLogin"] = attempt
return jsonify(status="pending"), 202
if result["status"] != "succeeded":
return redirect("/?auth_error=sign_in_failed", 303)
session.clear()
session["profile"] = result["profile"]
current_app.session_interface.regenerate(session)
return redirect("/", 303)
@auth.get("/profile")
def profile():
user = session.get("profile")
response = jsonify(user if user else {"error": "unauthorized"})
response.status_code = 200 if user else 401
response.headers["Cache-Control"] = "no-store"
return response
@auth.post("/logout")
def logout():
if request.headers.get("Origin") != origin:
abort(403)
session.clear()
return "", 204
# In your configured Flask app:
app.register_blueprint(auth, url_prefix="/auth")
python -m pip install anyoauth-sdkBackend SDK · application-owned routesCurrent source example · published 0.1.0 predates these helpers
Mount in your Gin app using an scs.SessionManager. Serve Gin through sessions.LoadAndSave(router), backed by your session store. Callback and session examples
package main
import (
"encoding/json"
"net/http"
"os"
"github.com/alexedwards/scs/v2"
"github.com/gin-gonic/gin"
anyoauth "github.com/AnyOAuth/anyoauth-go"
)
func mountAuth(router *gin.Engine, sessions *scs.SessionManager) {
origin := "http://localhost:3000"
client, err := anyoauth.NewClient("https://api.anyoauth.com", os.Getenv("ANYOAUTH_CLIENT_ID"), os.Getenv("ANYOAUTH_CLIENT_SECRET"))
if err != nil { panic(err) }
auth := router.Group("/auth")
auth.GET("/login/:provider", func(c *gin.Context) {
provider := c.Param("provider")
if provider != "google" && provider != "github" { c.AbortWithStatus(400); return }
value, err := client.StartLogin(map[string]any{"provider": provider, "redirectUri": origin + "/auth/callback"})
if err != nil { c.AbortWithStatus(502); return }
login := value.(map[string]any)
attempt, err := json.Marshal(login["loginAttempt"])
if err != nil { c.AbortWithStatus(500); return }
sessions.Put(c.Request.Context(), "pendingLogin", string(attempt))
c.Redirect(http.StatusSeeOther, login["url"].(string))
})
auth.GET("/callback", func(c *gin.Context) {
if c.Request.URL.RawQuery != "" || c.Request.URL.ForceQuery { c.AbortWithStatus(400); return }
saved := sessions.PopString(c.Request.Context(), "pendingLogin")
var attempt map[string]any
if saved == "" || json.Unmarshal([]byte(saved), &attempt) != nil { c.AbortWithStatus(400); return }
value, err := client.CompleteLogin(map[string]any{"loginAttempt": attempt})
if err != nil { c.AbortWithStatus(502); return }
result := value.(map[string]any)
if result["status"] == "pending" {
sessions.Put(c.Request.Context(), "pendingLogin", saved)
c.JSON(202, gin.H{"status": "pending"}); return
}
if result["status"] != "succeeded" { c.Redirect(303, "/?auth_error=sign_in_failed"); return }
if sessions.RenewToken(c.Request.Context()) != nil { c.AbortWithStatus(500); return }
profile, err := json.Marshal(result["profile"])
if err != nil { c.AbortWithStatus(500); return }
sessions.Put(c.Request.Context(), "profile", string(profile))
c.Redirect(303, "/")
})
auth.GET("/profile", func(c *gin.Context) {
c.Header("Cache-Control", "no-store")
profile := sessions.GetString(c.Request.Context(), "profile")
if profile == "" { c.JSON(401, gin.H{"error": "unauthorized"}); return }
c.Data(200, "application/json", []byte(profile))
})
auth.POST("/logout", func(c *gin.Context) {
if c.GetHeader("Origin") != origin { c.AbortWithStatus(403); return }
if sessions.Destroy(c.Request.Context()) != nil { c.AbortWithStatus(500); return }
c.Status(204)
})
}
go get github.com/AnyOAuth/anyoauth-goBackend SDK · application-owned routesCurrent source example
Add to routes/web.php, which already uses Laravel’s session middleware. Set services.anyoauth.client_id and client_secret in your configuration. Callback and session examples
<?php
// routes/web.php
use AnyOAuth\Client;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
$client = new Client(config('services.anyoauth.client_id'), config('services.anyoauth.client_secret'));
$origin = 'http://localhost:3000';
Route::prefix('auth')->group(function () use ($client, $origin) {
Route::get('login/{provider}', function (Request $request, string $provider) use ($client, $origin) {
abort_unless(in_array($provider, ['google', 'github'], true), 400);
$login = $client->startLogin(['provider' => $provider, 'redirectUri' => $origin . '/auth/callback']);
$request->session()->put('pendingLogin', $login->loginAttempt);
return redirect()->away($login->url, 303);
});
Route::get('callback', function (Request $request) use ($client) {
abort_if(str_contains($request->getRequestUri(), '?'), 400);
$attempt = $request->session()->pull('pendingLogin');
abort_if($attempt === null, 400);
try { $result = $client->completeLogin(['loginAttempt' => $attempt]); }
catch (\AnyOAuth\Error $error) { return response()->json(['error' => 'sign_in_failed'], 502); }
if ($result->status === 'pending') {
$request->session()->put('pendingLogin', $attempt);
return response()->json(['status' => 'pending'], 202);
}
if ($result->status !== 'succeeded') return redirect('/?auth_error=sign_in_failed', 303);
$request->session()->regenerate();
$request->session()->put('profile', $result->profile);
return redirect('/', 303);
});
Route::get('profile', function (Request $request) {
$profile = $request->session()->get('profile');
return response()->json($profile ?? ['error' => 'unauthorized'], $profile ? 200 : 401)
->header('Cache-Control', 'no-store');
});
Route::post('logout', function (Request $request) use ($origin) {
abort_unless($request->header('Origin') === $origin, 403);
$request->session()->invalidate();
$request->session()->regenerateToken();
return response()->noContent();
})->withoutMiddleware(\Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class);
});
composer require anyoauth/anyoauthBackend SDK · application-owned routesCurrent source example · published 0.1.0 predates these helpers
Add this Spring MVC controller to your Spring Boot app. Servlet HttpSession keeps the private login attempt on the server. Permit these auth routes in your Spring Security configuration, with the shown Origin check for logout. Callback and session examples
import com.anyoauth.AnyOAuth;
import com.google.gson.*;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.net.URI;
@RestController
@RequestMapping("/auth")
public class AuthController {
private final String origin = "http://localhost:3000";
private final AnyOAuth client = new AnyOAuth("https://api.anyoauth.com",
System.getenv("ANYOAUTH_CLIENT_ID"), System.getenv("ANYOAUTH_CLIENT_SECRET"));
@GetMapping("/login/{provider}")
public ResponseEntity<?> login(@PathVariable("provider") String provider, HttpServletRequest request) {
if (!provider.equals("google") && !provider.equals("github")) return ResponseEntity.badRequest().build();
var input = new JsonObject();
input.addProperty("provider", provider);
input.addProperty("redirectUri", origin + "/auth/callback");
var login = client.startLogin(input);
request.getSession().setAttribute("pendingLogin", login.getAsJsonObject("loginAttempt"));
return ResponseEntity.status(303).location(URI.create(login.get("url").getAsString())).build();
}
@GetMapping("/callback")
public ResponseEntity<?> callback(HttpServletRequest request) {
var session = request.getSession(false);
if (request.getQueryString() != null || session == null || session.getAttribute("pendingLogin") == null)
return ResponseEntity.badRequest().build();
var input = new JsonObject();
input.add("loginAttempt", (JsonObject) session.getAttribute("pendingLogin"));
session.removeAttribute("pendingLogin");
JsonObject result;
try { result = client.completeLogin(input); }
catch (AnyOAuth.SDKException error) { return ResponseEntity.status(502).build(); }
String status = result.get("status").getAsString();
if (status.equals("pending")) {
session.setAttribute("pendingLogin", input.getAsJsonObject("loginAttempt"));
return ResponseEntity.status(202).body(java.util.Map.of("status", "pending"));
}
if (!status.equals("succeeded")) return ResponseEntity.status(303).location(URI.create("/?auth_error=sign_in_failed")).build();
request.changeSessionId();
session.setAttribute("profile", result.getAsJsonObject("profile").toString());
return ResponseEntity.status(303).location(URI.create("/")).build();
}
@GetMapping("/profile")
public ResponseEntity<String> profile(HttpServletRequest request) {
var session = request.getSession(false);
String profile = session == null ? null : (String) session.getAttribute("profile");
return ResponseEntity.status(profile == null ? 401 : 200).header("Cache-Control", "no-store")
.header("Content-Type", "application/json").body(profile == null ? "{\"error\":\"unauthorized\"}" : profile);
}
@PostMapping("/logout")
public ResponseEntity<?> logout(HttpServletRequest request) {
if (!origin.equals(request.getHeader("Origin"))) return ResponseEntity.status(403).build();
var session = request.getSession(false);
if (session != null) session.invalidate();
return ResponseEntity.noContent().build();
}
}
Gradle: implementation("com.anyoauth:anyoauth:0.1.0")Backend SDK · application-owned routesCurrent source example · published 0.1.0 predates these helpers
Add the routes and controller shown below. Use Rails’ encrypted cookie session or a server-side session store; the private attempt must not go in a signed-only cookie. Callback and session examples
# config/routes.rb
Rails.application.routes.draw do
get '/auth/login/:provider', to: 'auth#login'
get '/auth/callback', to: 'auth#callback'
get '/auth/profile', to: 'auth#profile'
post '/auth/logout', to: 'auth#logout'
end
# app/controllers/auth_controller.rb
require 'anyoauth'
class AuthController < ApplicationController
skip_forgery_protection only: :logout # The logout action checks Origin below.
ORIGIN = 'http://localhost:3000'
def login
return head(:bad_request) unless %w[google github].include?(params[:provider])
login = client.start_login('provider' => params[:provider], 'redirectUri' => ORIGIN + '/auth/callback')
session[:pendingLogin] = login['loginAttempt']
redirect_to login['url'], status: :see_other, allow_other_host: true
end
def callback
return head(:bad_request) unless request.query_string.empty? && session[:pendingLogin]
attempt = session.delete(:pendingLogin)
result = client.complete_login('loginAttempt' => attempt)
if result['status'] == 'pending'
session[:pendingLogin] = attempt
return render json: {status: 'pending'}, status: :accepted
end
return redirect_to('/?auth_error=sign_in_failed', status: :see_other) unless result['status'] == 'succeeded'
reset_session
session[:profile] = result['profile']
redirect_to '/', status: :see_other
rescue AnyOAuth::Error
head :bad_gateway
end
def profile
response.headers['Cache-Control'] = 'no-store'
render json: session[:profile] || {error: 'unauthorized'}, status: session[:profile] ? :ok : :unauthorized
end
def logout
return head(:forbidden) unless request.headers['Origin'] == ORIGIN
reset_session
head :no_content
end
private
def client
@client ||= AnyOAuth::Client.new(ENV.fetch('ANYOAUTH_CLIENT_ID'), ENV.fetch('ANYOAUTH_CLIENT_SECRET'))
end
end
gem install anyoauth-sdkBackend SDK · application-owned routesCurrent source example · published 0.1.0 predates these helpers
Add these endpoints after UseSession(), UseAuthentication() and UseAuthorization(). Configure a distributed session store and AddAuthentication("anyoauth").AddCookie("anyoauth") in your app’s services. Callback and session examples
using System.Security.Claims;
using System.Text.Json.Nodes;
using Microsoft.AspNetCore.Authentication;
using AnyOAuth;
// In Program.cs, after configuring sessions and the "anyoauth" cookie scheme.
var origin = "http://localhost:3000";
var client = new Client(clientId: builder.Configuration["ANYOAUTH_CLIENT_ID"]!,
clientSecret: builder.Configuration["ANYOAUTH_CLIENT_SECRET"]!);
var auth = app.MapGroup("/auth").AllowAnonymous();
auth.MapGet("/login/{provider}", async Task<IResult> (string provider, HttpContext context) => {
if (provider is not ("google" or "github")) return Results.BadRequest();
var login = (await client.StartLogin(new JsonObject {
["provider"] = provider, ["redirectUri"] = origin + "/auth/callback"
}))!;
context.Session.SetString("pendingLogin", login["loginAttempt"]!.ToJsonString());
await context.Session.CommitAsync();
context.Response.StatusCode = 303;
context.Response.Headers.Location = login["url"]!.GetValue<string>();
return Results.Empty;
});
auth.MapGet("/callback", async Task<IResult> (HttpContext context) => {
var attempt = context.Session.GetString("pendingLogin");
if (context.Request.QueryString.HasValue || attempt is null) return Results.BadRequest();
context.Session.Remove("pendingLogin");
await context.Session.CommitAsync();
JsonNode result;
try { result = (await client.CompleteLogin(new JsonObject { ["loginAttempt"] = JsonNode.Parse(attempt) }))!; }
catch (SDKException) { return Results.StatusCode(502); }
if (result["status"]!.GetValue<string>() == "pending") {
context.Session.SetString("pendingLogin", attempt);
return Results.Json(new { status = "pending" }, statusCode: 202);
}
if (result["status"]!.GetValue<string>() != "succeeded") return Results.Redirect("/?auth_error=sign_in_failed");
var claims = new[] {
new Claim(ClaimTypes.NameIdentifier, result["profile"]!["subject"]!.GetValue<string>()),
new Claim("profile", result["profile"]!.ToJsonString())
};
await context.SignInAsync("anyoauth", new ClaimsPrincipal(new ClaimsIdentity(claims, "anyoauth")));
context.Response.StatusCode = 303;
context.Response.Headers.Location = "/";
return Results.Empty;
});
auth.MapGet("/profile", IResult (HttpContext context) => {
context.Response.Headers.CacheControl = "no-store";
var profile = context.User.FindFirst("profile")?.Value;
return profile is null ? Results.Unauthorized() : Results.Json(JsonNode.Parse(profile));
});
auth.MapPost("/logout", async Task<IResult> (HttpContext context) => {
if (context.Request.Headers.Origin != origin) return Results.StatusCode(403);
context.Session.Clear();
await context.SignOutAsync("anyoauth");
return Results.NoContent();
});
dotnet add reference /path/to/anyoauth/sdks/dotnet/AnyOAuth.SDK.csprojBackend SDK · application-owned routesCurrent source example
Merge auth_routes() into your Axum app and apply a tower-sessions SessionManagerLayer with your session store. Set SameSite=Lax and Secure on HTTPS. SDK HTTP calls run in spawn_blocking, including client construction and destruction. Callback and session examples
use axum::{extract::{OriginalUri, Path}, http::{HeaderMap, StatusCode},
response::{IntoResponse, Redirect, Response}, routing::{get, post}, Json, Router};
use serde_json::{json, Value};
use tower_sessions::Session;
use anyoauth_sdk::Client;
const ORIGIN: &str = "http://localhost:3000";
fn client() -> Client {
Client::new("https://api.anyoauth.com", &std::env::var("ANYOAUTH_CLIENT_ID").unwrap(),
&std::env::var("ANYOAUTH_CLIENT_SECRET").unwrap()).unwrap()
}
pub fn auth_routes() -> Router {
Router::new()
.route("/auth/login/{provider}", get(login))
.route("/auth/callback", get(callback))
.route("/auth/profile", get(profile))
.route("/auth/logout", post(logout))
}
async fn login(Path(provider): Path<String>, session: Session) -> Result<Response, StatusCode> {
if provider != "google" && provider != "github" { return Err(StatusCode::BAD_REQUEST); }
let login = tokio::task::spawn_blocking(move || client().start_login(&json!({
"provider": provider, "redirectUri": format!("{ORIGIN}/auth/callback")
}))).await.map_err(|_| StatusCode::BAD_GATEWAY)?.map_err(|_| StatusCode::BAD_GATEWAY)?;
session.insert("pendingLogin", &login["loginAttempt"]).await.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
Ok(Redirect::to(login["url"].as_str().unwrap()).into_response())
}
async fn callback(OriginalUri(uri): OriginalUri, session: Session) -> Result<Response, StatusCode> {
if uri.query().is_some() { return Err(StatusCode::BAD_REQUEST); }
let attempt: Value = session.remove("pendingLogin").await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?.ok_or(StatusCode::BAD_REQUEST)?;
session.save().await.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
let saved = attempt.clone();
let result = tokio::task::spawn_blocking(move || client().complete_login(&json!({"loginAttempt": attempt})))
.await.map_err(|_| StatusCode::BAD_GATEWAY)?.map_err(|_| StatusCode::BAD_GATEWAY)?;
if result["status"] == "pending" {
session.insert("pendingLogin", saved).await.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
return Ok((StatusCode::ACCEPTED, Json(json!({"status": "pending"}))).into_response());
}
if result["status"] != "succeeded" { return Ok(Redirect::to("/?auth_error=sign_in_failed").into_response()); }
session.cycle_id().await.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
session.insert("profile", &result["profile"]).await.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
Ok(Redirect::to("/").into_response())
}
async fn profile(session: Session) -> Result<Response, StatusCode> {
let user: Option<Value> = session.get("profile").await.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
let mut response = match user {
Some(user) => Json(user).into_response(),
None => (StatusCode::UNAUTHORIZED, Json(json!({"error": "unauthorized"}))).into_response(),
};
response.headers_mut().insert("cache-control", "no-store".parse().unwrap());
Ok(response)
}
async fn logout(headers: HeaderMap, session: Session) -> Result<StatusCode, StatusCode> {
if headers.get("origin").and_then(|h| h.to_str().ok()) != Some(ORIGIN) { return Err(StatusCode::FORBIDDEN); }
session.flush().await.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;
Ok(StatusCode::NO_CONTENT)
}
cargo add anyoauth-sdkBackend SDK · application-owned routesCurrent source example · published 0.1.0 predates these helpers
Add the router scope and controller to your Phoenix app. Configure encrypted Plug sessions (encryption_salt plus signing_salt) or a server-side store. The auth_session pipeline uses the explicit Origin check for logout. Callback and session examples
# lib/my_app_web/router.ex — inside MyAppWeb.Router
pipeline :auth_session do
plug :fetch_session
end
scope "/auth", MyAppWeb do
pipe_through :auth_session
get "/login/:provider", AuthController, :login
get "/callback", AuthController, :callback
get "/profile", AuthController, :profile
post "/logout", AuthController, :logout
end
# lib/my_app_web/controllers/auth_controller.ex
defmodule MyAppWeb.AuthController do
use MyAppWeb, :controller
@origin "http://localhost:3000"
def login(conn, %{"provider" => provider}) when provider in ["google", "github"] do
login = AnyOAuth.start_login(client(), %{"provider" => provider, "redirectUri" => @origin <> "/auth/callback"})
conn |> put_session(:pendingLogin, login["loginAttempt"]) |> redirect(external: login["url"])
end
def login(conn, _), do: send_resp(conn, 400, "Invalid provider")
def callback(conn, _) do
attempt = get_session(conn, :pendingLogin)
if conn.query_string != "" or is_nil(attempt) do
send_resp(conn, 400, "Invalid callback")
else
finish(delete_session(conn, :pendingLogin), attempt)
end
end
defp finish(conn, attempt) do
case AnyOAuth.complete_login(client(), %{"loginAttempt" => attempt}) do
%{"status" => "pending"} -> conn |> put_session(:pendingLogin, attempt) |> put_status(202) |> json(%{status: "pending"})
%{"status" => "succeeded", "profile" => profile} ->
conn |> clear_session() |> configure_session(renew: true) |> put_session(:profile, profile) |> redirect(to: "/")
_ -> redirect(conn, to: "/?auth_error=sign_in_failed")
end
rescue
_ in AnyOAuth.Error -> send_resp(conn, 502, "Sign-in failed")
end
def profile(conn, _) do
conn = put_resp_header(conn, "cache-control", "no-store")
case get_session(conn, :profile) do
nil -> conn |> put_status(401) |> json(%{error: "unauthorized"})
profile -> json(conn, profile)
end
end
def logout(conn, _) do
if get_req_header(conn, "origin") == [@origin] do
conn |> clear_session() |> configure_session(drop: true) |> send_resp(204, "")
else
send_resp(conn, 403, "Invalid origin")
end
end
defp client, do: AnyOAuth.new(System.fetch_env!("ANYOAUTH_CLIENT_ID"), System.fetch_env!("ANYOAUTH_CLIENT_SECRET"))
end
mix.exs: {:anyoauth_sdk, "~> 0.1"}Backend SDK · application-owned routesCurrent source example · published 0.1.0 predates these helpers
import { AnyOAuth } from "@anyoauth/node";
const client = new AnyOAuth({
clientId: process.env.ANYOAUTH_CLIENT_ID ?? "YOUR_CLIENT_ID",
clientSecret: process.env.ANYOAUTH_CLIENT_SECRET ?? "YOUR_CLIENT_SECRET",
baseUrl: process.env.ANYOAUTH_API_ORIGIN ?? "https://api.anyoauth.com",
});
// After this call, save loginAttempt in the browser-bound server session, persist it, then redirect to url.
const login = await client.startLogin({
provider: "google",
redirectUri: process.env.ANYOAUTH_REDIRECT_URI ?? "https://your-app.example/auth/callback"
});
npm install @anyoauth/nodeConfidential backend SDKCurrent source example · published 0.1.0 predates these helpers
import os
from anyoauth import Client
client = Client(os.getenv("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), os.getenv("ANYOAUTH_CLIENT_SECRET", "YOUR_CLIENT_SECRET"), os.getenv("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"))
# After this call, save loginAttempt in the browser-bound server session, persist it, then redirect to url.
login = client.start_login({"provider": "google", "redirectUri": os.getenv("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback")})
python -m pip install anyoauth-sdkConfidential backend SDKCurrent source example · published 0.1.0 predates these helpers
package main
import (
"os"
anyoauth "github.com/AnyOAuth/anyoauth-go"
)
func env(key, fallback string) string { if v := os.Getenv(key); v != "" { return v }; return fallback }
func main() {
// After this call, save loginAttempt in the browser-bound server session, persist it, then redirect to url.
client, err := anyoauth.NewClient(env("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"), env("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), env("ANYOAUTH_CLIENT_SECRET", "YOUR_CLIENT_SECRET"))
if err != nil { panic(err) }
login, err := client.StartLogin(map[string]any{"provider": "google", "redirectUri": env("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback")})
if err != nil { panic(err) }
_ = login
}
go get github.com/AnyOAuth/anyoauth-goConfidential backend SDKCurrent source example
<?php
require 'vendor/autoload.php';
$client = new \AnyOAuth\Client((getenv("ANYOAUTH_CLIENT_ID") ?: "YOUR_CLIENT_ID"), (getenv("ANYOAUTH_CLIENT_SECRET") ?: "YOUR_CLIENT_SECRET"), (getenv("ANYOAUTH_API_ORIGIN") ?: "https://api.anyoauth.com"));
// After this call, save loginAttempt in the browser-bound server session, persist it, then redirect to url.
$login = $client->startLogin(["provider" => "google", "redirectUri" => (getenv("ANYOAUTH_REDIRECT_URI") ?: "https://your-app.example/auth/callback")]);
composer require anyoauth/anyoauthConfidential backend SDKCurrent source example · published 0.1.0 predates these helpers
import com.anyoauth.AnyOAuth;
import com.google.gson.*;
public class Example {
static String env(String key, String fallback) { String value = System.getenv(key); return value == null ? fallback : value; }
public static void main(String[] args) {
// After this call, save loginAttempt in the browser-bound server session, persist it, then redirect to url.
AnyOAuth client = new AnyOAuth(env("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"), env("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), env("ANYOAUTH_CLIENT_SECRET", "YOUR_CLIENT_SECRET"));
JsonObject params = new JsonObject();
params.addProperty("provider", "google");
params.addProperty("redirectUri", env("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback"));
var login = client.startLogin(params);
}
}
Gradle: implementation("com.anyoauth:anyoauth:0.1.0")Confidential backend SDKCurrent source example · published 0.1.0 predates these helpers
require "anyoauth"
client = AnyOAuth::Client.new(ENV.fetch("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), ENV.fetch("ANYOAUTH_CLIENT_SECRET", "YOUR_CLIENT_SECRET"), ENV.fetch("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"))
# After this call, save loginAttempt in the browser-bound server session, persist it, then redirect to url.
login = client.start_login({"provider" => "google", "redirectUri" => ENV.fetch("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback")})
gem install anyoauth-sdkConfidential backend SDKCurrent source example · published 0.1.0 predates these helpers
using System;
using System.Text.Json.Nodes;
using AnyOAuth;
// After this call, save loginAttempt in the browser-bound server session, persist it, then redirect to url.
using var client = new Client(Environment.GetEnvironmentVariable("ANYOAUTH_API_ORIGIN") ?? "https://api.anyoauth.com", Environment.GetEnvironmentVariable("ANYOAUTH_CLIENT_ID") ?? "YOUR_CLIENT_ID", Environment.GetEnvironmentVariable("ANYOAUTH_CLIENT_SECRET") ?? "YOUR_CLIENT_SECRET");
var login = await client.StartLogin(new JsonObject { ["provider"] = "google", ["redirectUri"] = Environment.GetEnvironmentVariable("ANYOAUTH_REDIRECT_URI") ?? "https://your-app.example/auth/callback" });
dotnet add reference /path/to/anyoauth/sdks/dotnet/AnyOAuth.SDK.csprojConfidential backend SDKCurrent source example
use anyoauth_sdk::*;
use serde_json::json;
fn env(key: &str, fallback: &str) -> String { std::env::var(key).unwrap_or_else(|_| fallback.to_owned()) }
fn main() -> Result<(), Box<dyn std::error::Error>> {
// After this call, save loginAttempt in the browser-bound server session, persist it, then redirect to url.
let client = Client::new(&env("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"), &env("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), &env("ANYOAUTH_CLIENT_SECRET", "YOUR_CLIENT_SECRET"))?;
let login = client.start_login(&json!({"provider": "google", "redirectUri": env("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback")}))?;
let _ = &login;
Ok(())
}
cargo add anyoauth-sdkConfidential backend SDKCurrent source example · published 0.1.0 predates these helpers
client = AnyOAuth.new((System.get_env("ANYOAUTH_CLIENT_ID") || "YOUR_CLIENT_ID"), (System.get_env("ANYOAUTH_CLIENT_SECRET") || "YOUR_CLIENT_SECRET"), (System.get_env("ANYOAUTH_API_ORIGIN") || "https://api.anyoauth.com"))
# After this call, save loginAttempt in the browser-bound server session, persist it, then redirect to url.
login = AnyOAuth.start_login(client, %{"provider" => "google", "redirectUri" => (System.get_env("ANYOAUTH_REDIRECT_URI") || "https://your-app.example/auth/callback")})
mix.exs: {:anyoauth_sdk, "~> 0.1"}Confidential backend SDKCurrent source example · published 0.1.0 predates these helpers
- Node.js / TypeScript —
@anyoauth/node - Python —
anyoauth-sdk - Go —
github.com/AnyOAuth/anyoauth-go - PHP —
anyoauth/anyoauth - Java —
com.anyoauth:anyoauth - Ruby —
anyoauth-sdk - .NET —
AnyOAuth.SDK - Rust —
anyoauth-sdk - Elixir —
anyoauth_sdk
Frontend frameworks
One browser SDK, the same simple login call in HTML, React, Vue, Astro, Svelte, Next.js and Nuxt. Full profile and sign-out examples.
import * as anyoauth from '@anyoauth/client';
export default function Login() {
return <button onClick={() => anyoauth.startLogin('google')}>
Sign in with Google
</button>;
}
npm install @anyoauth/clientBrowser helpers · uses your backend sessionCurrent source example · published 0.1.0 predates these helpers
<script setup>
import * as anyoauth from '@anyoauth/client';
</script>
<template>
<button @click="anyoauth.startLogin('google')">Sign in with Google</button>
</template>
npm install @anyoauth/clientBrowser helpers · uses your backend sessionCurrent source example · published 0.1.0 predates these helpers
<button id="google">Sign in with Google</button>
<script>
import * as anyoauth from '@anyoauth/client';
document.querySelector('#google').addEventListener('click', () => {
anyoauth.startLogin('google');
});
</script>
npm install @anyoauth/clientBrowser helpers · uses your backend sessionCurrent source example · published 0.1.0 predates these helpers
<button id="google">Sign in with Google</button>
<script type="module">
import * as anyoauth from '/auth-client.js';
document.querySelector('#google').addEventListener('click', () => {
anyoauth.startLogin('google');
});
</script>
npm install @anyoauth/clientBrowser helpers · uses your backend sessionCurrent source example · published 0.1.0 predates these helpers
<script>
import * as anyoauth from '@anyoauth/client';
</script>
<button onclick={() => anyoauth.startLogin('google')}>Sign in with Google</button>
npm install @anyoauth/clientBrowser helpers · uses your backend sessionCurrent source example · published 0.1.0 predates these helpers
'use client';
import * as anyoauth from '@anyoauth/client';
export default function Login() {
return <button onClick={() => anyoauth.startLogin('google')}>
Sign in with Google
</button>;
}
npm install @anyoauth/clientBrowser helpers · uses your backend sessionCurrent source example · published 0.1.0 predates these helpers
<script setup>
import * as anyoauth from '@anyoauth/client';
</script>
<template>
<button @click="anyoauth.startLogin('google')">Sign in with Google</button>
</template>
npm install @anyoauth/clientBrowser helpers · uses your backend sessionCurrent source example · published 0.1.0 predates these helpers
Browser and mobile clients
Browser and mobile SDKs also provide secret-free state/PKCE and callback helpers for custom integrations. A confidential backend completes authentication. Choose Expo, Swift, Kotlin, Flutter or browser TypeScript in the language tabs below.
import { AnyOAuth } from "@anyoauth/node";
const client = new AnyOAuth({
clientId: process.env.ANYOAUTH_CLIENT_ID ?? "YOUR_CLIENT_ID",
clientSecret: process.env.ANYOAUTH_CLIENT_SECRET ?? "YOUR_CLIENT_SECRET",
baseUrl: process.env.ANYOAUTH_API_ORIGIN ?? "https://api.anyoauth.com",
});
const transaction = await client.createLoginAttempt();
// Persist this transaction in the initiating session before navigation.
const authorizationUrl = client.createLoginURL({
provider: "google",
redirectUri: process.env.ANYOAUTH_REDIRECT_URI ?? "https://your-app.example/auth/callback",
state: transaction.state,
codeChallenge: transaction.codeChallenge
});
npm install @anyoauth/nodeConfidential backend SDKCurrent source example · published 0.1.0 predates these helpers
// Supply these public settings from your app configuration.
const settings = globalThis.ANYOAUTH_SETTINGS ?? {};
import { AnyOAuth } from "@anyoauth/client";
const client = new AnyOAuth({
clientId: settings.ANYOAUTH_CLIENT_ID ?? "YOUR_CLIENT_ID",
baseUrl: settings.ANYOAUTH_API_ORIGIN ?? "https://api.anyoauth.com",
});
const transaction = await client.createLoginAttempt();
// Persist this transaction in the initiating session before navigation.
const authorizationUrl = client.createLoginURL({
provider: "google",
redirectUri: settings.ANYOAUTH_REDIRECT_URI ?? "https://your-app.example/auth/callback",
state: transaction.state,
codeChallenge: transaction.codeChallenge
});
npm install @anyoauth/clientClient helpers · backend exchange requiredCurrent source example · published 0.1.0 predates these helpers
// Supply these public settings from your app configuration.
const settings = globalThis.ANYOAUTH_SETTINGS ?? {};
import { AnyOAuth } from "@anyoauth/expo/native";
import * as Crypto from 'expo-crypto';
const client = new AnyOAuth({
crypto: Crypto,
clientId: settings.ANYOAUTH_CLIENT_ID ?? "YOUR_CLIENT_ID",
baseUrl: settings.ANYOAUTH_API_ORIGIN ?? "https://api.anyoauth.com",
});
const transaction = await client.createLoginAttempt();
// Persist this transaction in the initiating session before navigation.
const authorizationUrl = client.createLoginURL({
provider: "google",
redirectUri: settings.ANYOAUTH_REDIRECT_URI ?? "https://your-app.example/auth/callback",
state: transaction.state,
codeChallenge: transaction.codeChallenge
});
npm install @anyoauth/expoClient helpers · backend exchange requiredCurrent source example · published 0.1.0 predates these helpers
import os
from anyoauth import Client
client = Client(os.getenv("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), os.getenv("ANYOAUTH_CLIENT_SECRET", "YOUR_CLIENT_SECRET"), os.getenv("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"))
transaction = client.create_login_attempt()
# Persist the transaction in the initiating session.
authorizationUrl = client.create_login_url({"provider": "google", "redirectUri": os.getenv("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback"), "state": transaction["state"], "codeChallenge": transaction["codeChallenge"]})
python -m pip install anyoauth-sdkConfidential backend SDKCurrent source example · published 0.1.0 predates these helpers
package main
import (
"os"
anyoauth "github.com/AnyOAuth/anyoauth-go"
)
func env(key, fallback string) string { if v := os.Getenv(key); v != "" { return v }; return fallback }
func main() {
client, err := anyoauth.NewClient(env("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"), env("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), env("ANYOAUTH_CLIENT_SECRET", "YOUR_CLIENT_SECRET"))
if err != nil { panic(err) }
transaction, err := client.CreateLoginAttempt(nil)
if err != nil { panic(err) }
// Persist the transaction in the initiating session.
authorizationUrl, err := client.CreateLoginURL(map[string]any{"provider": "google", "redirectUri": env("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback"), "state": transaction["state"].(string), "codeChallenge": transaction["codeChallenge"].(string)})
if err != nil { panic(err) }
_ = authorizationUrl
}
go get github.com/AnyOAuth/anyoauth-goConfidential backend SDKCurrent source example
<?php
require 'vendor/autoload.php';
$client = new \AnyOAuth\Client((getenv("ANYOAUTH_CLIENT_ID") ?: "YOUR_CLIENT_ID"), (getenv("ANYOAUTH_CLIENT_SECRET") ?: "YOUR_CLIENT_SECRET"), (getenv("ANYOAUTH_API_ORIGIN") ?: "https://api.anyoauth.com"));
$transaction = $client->createLoginAttempt();
// Persist the transaction in the initiating session.
$authorizationUrl = $client->createLoginURL(["provider" => "google", "redirectUri" => (getenv("ANYOAUTH_REDIRECT_URI") ?: "https://your-app.example/auth/callback"), "state" => $transaction->state, "codeChallenge" => $transaction->codeChallenge]);
composer require anyoauth/anyoauthConfidential backend SDKCurrent source example · published 0.1.0 predates these helpers
import com.anyoauth.AnyOAuth;
import com.google.gson.*;
public class Example {
static String env(String key, String fallback) { String value = System.getenv(key); return value == null ? fallback : value; }
public static void main(String[] args) {
AnyOAuth client = new AnyOAuth(env("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"), env("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), env("ANYOAUTH_CLIENT_SECRET", "YOUR_CLIENT_SECRET"));
JsonObject transaction = client.createLoginAttempt(new JsonObject());
// Persist the transaction in the initiating session.
JsonObject params = new JsonObject();
params.addProperty("provider", "google");
params.addProperty("redirectUri", env("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback"));
params.addProperty("state", transaction.get("state").getAsString());
params.addProperty("codeChallenge", transaction.get("codeChallenge").getAsString());
var authorizationUrl = client.createLoginURL(params);
}
}
Gradle: implementation("com.anyoauth:anyoauth:0.1.0")Confidential backend SDKCurrent source example · published 0.1.0 predates these helpers
require "anyoauth"
client = AnyOAuth::Client.new(ENV.fetch("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), ENV.fetch("ANYOAUTH_CLIENT_SECRET", "YOUR_CLIENT_SECRET"), ENV.fetch("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"))
transaction = client.create_login_attempt
# Persist the transaction in the initiating session.
authorizationUrl = client.create_login_url({"provider" => "google", "redirectUri" => ENV.fetch("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback"), "state" => transaction["state"], "codeChallenge" => transaction["codeChallenge"]})
gem install anyoauth-sdkConfidential backend SDKCurrent source example · published 0.1.0 predates these helpers
using System;
using System.Text.Json.Nodes;
using AnyOAuth;
using var client = new Client(Environment.GetEnvironmentVariable("ANYOAUTH_API_ORIGIN") ?? "https://api.anyoauth.com", Environment.GetEnvironmentVariable("ANYOAUTH_CLIENT_ID") ?? "YOUR_CLIENT_ID", Environment.GetEnvironmentVariable("ANYOAUTH_CLIENT_SECRET") ?? "YOUR_CLIENT_SECRET");
var transaction = client.CreateLoginAttempt(new JsonObject());
// Persist the transaction in the initiating session.
var authorizationUrl = client.CreateLoginURL(new JsonObject { ["provider"] = "google", ["redirectUri"] = Environment.GetEnvironmentVariable("ANYOAUTH_REDIRECT_URI") ?? "https://your-app.example/auth/callback", ["state"] = transaction["state"]!.GetValue<string>(), ["codeChallenge"] = transaction["codeChallenge"]!.GetValue<string>() });
dotnet add reference /path/to/anyoauth/sdks/dotnet/AnyOAuth.SDK.csprojConfidential backend SDKCurrent source example
use anyoauth_sdk::*;
use serde_json::json;
fn env(key: &str, fallback: &str) -> String { std::env::var(key).unwrap_or_else(|_| fallback.to_owned()) }
fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new(&env("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"), &env("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), &env("ANYOAUTH_CLIENT_SECRET", "YOUR_CLIENT_SECRET"))?;
let transaction = client.create_login_attempt(&json!({}))?;
// Persist the transaction in the initiating session.
let authorizationUrl = client.create_login_url(&json!({"provider": "google", "redirectUri": env("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback"), "state": transaction["state"].as_str().unwrap(), "codeChallenge": transaction["codeChallenge"].as_str().unwrap()}))?;
let _ = &authorizationUrl;
Ok(())
}
cargo add anyoauth-sdkConfidential backend SDKCurrent source example · published 0.1.0 predates these helpers
client = AnyOAuth.new((System.get_env("ANYOAUTH_CLIENT_ID") || "YOUR_CLIENT_ID"), (System.get_env("ANYOAUTH_CLIENT_SECRET") || "YOUR_CLIENT_SECRET"), (System.get_env("ANYOAUTH_API_ORIGIN") || "https://api.anyoauth.com"))
transaction = AnyOAuth.create_login_attempt(client)
# Persist the transaction in the initiating session.
authorizationUrl = AnyOAuth.create_login_url(client, %{"provider" => "google", "redirectUri" => (System.get_env("ANYOAUTH_REDIRECT_URI") || "https://your-app.example/auth/callback"), "state" => transaction["state"], "codeChallenge" => transaction["codeChallenge"]})
mix.exs: {:anyoauth_sdk, "~> 0.1"}Confidential backend SDKCurrent source example · published 0.1.0 predates these helpers
import Foundation
import AnyOAuth
func env(_ key: String, _ fallback: String) -> String { ProcessInfo.processInfo.environment[key] ?? fallback }
let client = try AnyOAuth(clientId: env("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), baseUrl: env("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"))
let transaction = try client.createLoginAttempt()
// Persist the transaction in the initiating session.
let authorizationUrl = try client.createLoginURL(provider: "google", redirectUri: env("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback"), state: transaction.state, codeChallenge: transaction.codeChallenge)
.package(url: "https://github.com/AnyOAuth/anyoauth-swift.git", exact: "0.1.0")Client helpers · backend exchange requiredCurrent source example
import com.anyoauth.*
fun env(key: String, fallback: String): String = System.getenv(key) ?: fallback
fun main() {
val client = AnyOAuth(env("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), env("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"))
val transaction = client.createLoginAttempt()
// Persist the transaction in the initiating session.
val authorizationUrl = client.createLoginURL(provider = "google", redirectUri = env("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback"), state = transaction.state, codeChallenge = transaction.codeChallenge)
}
implementation("com.anyoauth:anyoauth-client:0.1.0")Client helpers · backend exchange requiredCurrent source example · published 0.1.0 predates these helpers
import 'dart:io';
import 'package:anyoauth_client/anyoauth_client.dart';
String env(String key, String fallback) => Platform.environment[key] ?? fallback;
void main() {
final client = AnyOAuth(clientId: env("ANYOAUTH_CLIENT_ID", "YOUR_CLIENT_ID"), baseUrl: env("ANYOAUTH_API_ORIGIN", "https://api.anyoauth.com"));
final transaction = client.createLoginAttempt();
// Persist the transaction in the initiating session.
final authorizationUrl = client.createLoginURL(provider: "google", redirectUri: env("ANYOAUTH_REDIRECT_URI", "https://your-app.example/auth/callback"), state: transaction.state, codeChallenge: transaction.codeChallenge);
}
flutter pub add anyoauth_client --path /path/to/anyoauth/sdks/clients/flutterClient helpers · backend exchange requiredCurrent source example
- Browser TypeScript —
@anyoauth/client - Expo —
@anyoauth/expo - Swift —
AnyOAuth - Kotlin —
com.anyoauth:anyoauth-client - Flutter / Dart —
anyoauth_client
Published registry packages
10 packages have verified 0.1.0 releases. Use the version-pinned installs below and examples for their released API. Newer managed adapters and named browser session exports are source-only until their next release.
- PyPI — anyoauth-sdk 0.1.0
python -m pip install anyoauth-sdk==0.1.0 - RubyGems — anyoauth-sdk 0.1.0
gem install anyoauth-sdk --version 0.1.0 - npm — @anyoauth/node 0.1.0
npm install @anyoauth/node@0.1.0 - npm — @anyoauth/client 0.1.0
npm install @anyoauth/client@0.1.0 - npm — @anyoauth/expo 0.1.0
npm install @anyoauth/expo@0.1.0 - crates.io — anyoauth-sdk 0.1.0
cargo add anyoauth-sdk@=0.1.0 - Hex — anyoauth_sdk 0.1.0
# mix.exs deps: {:anyoauth_sdk, "0.1.0"} - Packagist — anyoauth/anyoauth 0.1.0
composer require anyoauth/anyoauth:0.1.0 - Maven Central — com.anyoauth:anyoauth 0.1.0
<dependency><groupId>com.anyoauth</groupId><artifactId>anyoauth</artifactId><version>0.1.0</version></dependency> - Maven Central — com.anyoauth:anyoauth-client 0.1.0
implementation("com.anyoauth:anyoauth-client:0.1.0")
Versioned source distribution
Go and Swift resolve GitHub v0.1.0 tags directly. NuGet and pub.dev publication is pending; follow their versioned source build instructions. Each SDK has a public repository with native tests and source checksums. The website does not host SDK package archives.
go get github.com/AnyOAuth/anyoauth-go@v0.1.0
# SwiftPM:
.package(url: "https://github.com/AnyOAuth/anyoauth-swift.git", exact: "0.1.0")Run the published-package walkthrough · Released API and source-version boundary · Model schemas
Browse the AnyOAuth organization · Read the integration quickstart