Enterprise-grade Single Sign-On integration for any website. One script, full control, beautiful UI.
A complete SSO toolkit designed for developers who demand both simplicity and power.
Add a single script tag to enable SSO. No build tools, no npm install, no server changes.
Automatically checks if visitors are logged into Kiges ID and shows a personalized prompt.
Buttons and prompts auto-translate based on browser language. Override with a single option.
Light, dark, and auto modes. Three button styles. Five popup positions. Full CSS control.
Pure vanilla JavaScript. Under 18 KB gzipped. Works in all modern browsers.
Industry-standard authorization code flow with PKCE support and CSRF protection.
From zero to working SSO button in under 2 minutes.
Include the SDK in your HTML. Use data attributes for zero-config setup.
<!-- Add before </body> -->
<script
src="https://id.kiges.cc/js/kiges-id-sdk.js"
data-kiges-client-id="YOUR_CLIENT_ID"
data-kiges-redirect-uri="https://yoursite.com/callback"
data-kiges-auto-prompt="true">
</script>
Listen for the authorization code on your callback page.
KigesID.init({
clientId: 'YOUR_CLIENT_ID',
redirectUri: 'https://yoursite.com/callback',
onSuccess: function(data) {
// data.code = authorization code
// Send to your server to exchange for token
fetch('/auth/kiges/callback', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ code: data.code })
});
},
onError: function(error) {
console.error('Auth failed:', error);
}
});
Exchange the authorization code for an access token on your backend.
// routes/web.php
Route::post('/auth/kiges/callback', function (Request $request) {
$response = Http::asForm()->post('https://id.kiges.cc/oauth/token', [
'grant_type' => 'authorization_code',
'client_id' => config('services.kiges.client_id'),
'client_secret' => config('services.kiges.client_secret'),
'redirect_uri' => config('services.kiges.redirect'),
'code' => $request->code,
]);
$user = Http::withToken($response['access_token'])
->get('https://id.kiges.cc/api/user');
// Create or update user in your database
Auth::login(User::updateOrCreate(
['kiges_id' => $user['id']],
['name' => $user['name'], 'email' => $user['email']]
));
return redirect('/dashboard');
});
Choose the approach that fits your project. All methods are fully supported.
The simplest approach. Just add data attributes to the script tag and the SDK handles everything automatically.
<script
src="https://id.kiges.cc/js/kiges-id-sdk.js"
data-kiges-client-id="YOUR_CLIENT_ID"
data-kiges-redirect-uri="https://yoursite.com/callback"
data-kiges-auto-prompt="true"
data-kiges-theme="dark"
data-kiges-position="bottom-right"
data-kiges-button="#login-btn">
</script>
<!-- Button will render here -->
<div id="login-btn"></div>
For maximum customization and programmatic control over every aspect of the SSO flow.
<script src="https://id.kiges.cc/js/kiges-id-sdk.js"></script>
<script>
// Initialize with full options
KigesID.init({
clientId: 'YOUR_CLIENT_ID',
redirectUri: 'https://yoursite.com/callback',
hostedSignInUrl: 'YOUR_HOSTED_SIGN_IN_URL',
hostedSignUpUrl: 'YOUR_HOSTED_SIGN_UP_URL',
scope: 'openid profile email',
autoPrompt: true,
promptPosition: 'bottom-right',
promptDelay: 3000,
theme: 'auto',
onSuccess: (data) => console.log('Success:', data),
onError: (err) => console.error('Error:', err),
onDismiss: () => console.log('Dismissed')
});
// Render a styled button
KigesID.renderButton('#my-button', {
theme: 'primary',
size: 'large',
fullWidth: true,
showIcon: true,
mode: 'popup'
});
KigesID.renderSignUpButton('#my-register-button', {
theme: 'outline',
mode: 'redirect'
});
</script>
Install via npm for bundler-friendly integration with React, Vue, Angular, and other frameworks.
# Coming soon
npm install @kiges/id-sdk
# React
import { KigesIDButton } from '@kiges/id-sdk/react';
# Vue
import { KigesIDButton } from '@kiges/id-sdk/vue';
All available options for initialization and button rendering.
| Option | Type | Default | Description |
|---|---|---|---|
clientId |
string | - | Required. Your Kiges ID application client ID. |
redirectUri |
string | window.location.origin + '/callback' |
OAuth callback URL registered in your app. |
scope |
string | 'openid profile email' |
Space-separated OAuth scopes to request. |
autoPrompt |
boolean | true |
Show a popup prompt for logged-in Kiges users. |
promptPosition |
string | 'bottom-right' |
Popup position: bottom-right, bottom-left, top-right, top-left, center. |
promptDelay |
number | 2000 |
Delay in ms before showing the auto-prompt. |
theme |
string | 'auto' |
UI theme: light, dark, or auto (follows system). |
onSuccess |
function | - | Callback on successful authorization. Receives { code }. |
onError |
function | - | Callback on error. Receives error object. |
onDismiss |
function | - | Callback when user dismisses the prompt. |
| Option | Type | Default | Description |
|---|---|---|---|
text |
string | auto | Button text. Auto-translated if not specified. |
theme |
string | 'primary' |
Button style: primary, outline, or minimal. |
size |
string | 'medium' |
Button size: small, medium, or large. |
fullWidth |
boolean | false |
Stretch button to fill container width. |
showIcon |
boolean | true |
Show the Kiges ID logo icon on the button. |
mode |
string | 'redirect' |
Login mode: redirect (full page) or popup (new window). |
All public methods available on the KigesID global object.
Initialize the SDK with your configuration. Must be called before other methods.
Programmatically trigger the OAuth login flow.
Programmatically open the hosted account registration flow.
Clear local auth state. Set endKigesSession: true to end the central Kiges ID session.
Check if the current user is logged into Kiges ID.
Render a styled login button into the given CSS selector.
Render a styled registration button into the given CSS selector.
Manually show the SSO prompt popup.
Hide the SSO prompt popup if visible.
Get the cached user information object.
Returns true if the user is currently authenticated.
Clean up all SDK elements and event listeners.
Ready-to-use integration examples for popular frameworks.
import { useEffect, useRef } from 'react';
function KigesLoginButton({ clientId, onSuccess }) {
const btnRef = useRef(null);
useEffect(() => {
// Load SDK
const script = document.createElement('script');
script.src = 'https://id.kiges.cc/js/kiges-id-sdk.js';
script.onload = () => {
window.KigesID.init({
clientId,
onSuccess,
onError: (err) => console.error(err)
});
window.KigesID.renderButton(btnRef.current, {
theme: 'primary',
size: 'large',
fullWidth: true
});
};
document.body.appendChild(script);
return () => window.KigesID?.destroy();
}, [clientId]);
return <div ref={btnRef} />;
}
export default KigesLoginButton;
<template>
<div ref="btnContainer" />
</template>
<script setup>
import { ref, onMounted, onUnmounted } from 'vue';
const props = defineProps({ clientId: String });
const emit = defineEmits(['success', 'error']);
const btnContainer = ref(null);
onMounted(() => {
const script = document.createElement('script');
script.src = 'https://id.kiges.cc/js/kiges-id-sdk.js';
script.onload = () => {
window.KigesID.init({
clientId: props.clientId,
onSuccess: (data) => emit('success', data),
onError: (err) => emit('error', err)
});
window.KigesID.renderButton(btnContainer.value, {
theme: 'primary', size: 'large', fullWidth: true
});
};
document.body.appendChild(script);
});
onUnmounted(() => window.KigesID?.destroy());
</script>
Interact with a live instance of the SDK. Click the buttons below to test different popup positions.
This is a live-rendered Kiges ID button.
Click a position to see the SSO prompt appear there.