Installation
Choose the installation method that fits your project.
When you're logged in to the Developer Portal, go to Settings → Quick configuration to get all credentials and code pre-filled for your app (no placeholders).
Option 1: Script Tag (Vanilla HTML/JS)
Add the LoginSign platform library to your HTML document:
<!DOCTYPE html> <html> <head> <meta name="LoginSign-signin-client_id" content="YOUR_CLIENT_ID.apps.loginsignusercontent.com"> <script src="https://apis.loginsign.com/js/platform.js" async defer></script> </head> <body> <!-- Your sign-in button will go here --> </body> </html>
Option 2: NPM Package (React / Next.js)
Install the official LoginSign React package:
npm install @loginsign/react
Wrap your app with the provider:
// app/layout.tsx (Next.js App Router)
import { LoginSignProvider } from '@loginsign/react'
export default function RootLayout({ children }) {
return (
<html>
<body>
<LoginSignProvider clientId="YOUR_CLIENT_ID.apps.loginsignusercontent.com">
{children}
</LoginSignProvider>
</body>
</html>
)
}Option 3: Redirect-based sign-in
LoginSign uses OAuth 2.0 with redirects. To trigger sign-in, redirect the user to the authorization URL (see OAuth Flow). There is no client-side SDK that returns an id_token in the page; your callback receives a code which you exchange for an access token on your server.
Static HTML / static site hosting
On pure static sites (no server), the OAuth callback page will receive ?code=... in the URL but cannot exchange the code for tokens by itself (that requires your Client Secret, which must stay server-side). Use one of these approaches:
- Serverless function: Add a small serverless endpoint (e.g. Vercel, Netlify) that receives the callback, exchanges the code for tokens with LoginSign's token URL, then redirects the user to your static app with a session cookie or token in the URL fragment.
- Redirect URI: In Settings → Redirect URIs, add the exact URL of your callback page (e.g.
https://yoursite.com/callback.html). Use the Quick configuration in Settings to copy a ready-made static HTML example.
Continue to Integration for the sign-in button and callbacks.