Add Sign in with Twetch
This issuer speaks OpenID Connect. Auth.js, Passport, and other OIDC libraries work with three values: issuer, client id, and client secret.
1. Register an app
Open the developer console, create a client, and set the callback to:
https://your-app.example/api/auth/callback/twetch
Redirect URIs are exact-match. Localhost HTTP is allowed for development.
2. Auth.js / NextAuth provider
import Twetch from "@twetch/authjs-provider";
export const { handlers, auth } = NextAuth({
providers: [
Twetch({
issuer: "https://id.entangleit.com",
clientId: process.env.TWETCH_CLIENT_ID,
clientSecret: process.env.TWETCH_CLIENT_SECRET,
}),
],
});
3. Button
<link rel="stylesheet" href="https://id.entangleit.com/public/sign-in-with-twetch.css" /> <a class="siwt" href="/api/auth/signin/twetch"> <span class="siwt-mark"></span> Sign in with Twetch </a>Sign in with Twetch
Claims
sub is the Twetch user id. It does not change when a user rotates signing keys.