Learn how you can integrate and configure the Authiqa authentication widget
data-public-key
: Your PUBLIC keyaction
: Authentication action (signin
, signup
, reset
, update
, verify
, resend
)defer
: For proper script loadingtheme
: "light"
(default) or "dark"
preset
: Select a predefined design preset. One of modern
, classic
, corporate
, sharp
, minimal
disable-styles
: "true"
or "false"
(default)termsAndConditions
: URL for terms and conditions pageprivacy
: URL for privacy policynotificationSettings
: URL for notification settingsbuttonName
: Custom text for submit buttondata-messages
: JSON string containing custom success and loading messagessuccessAuthPath
: Custom URL to redirect after successful sign insigninAuthPath
: Custom URL to redirect after email verificationverifyAuthPath
: Custom URL for email verification pageupdatePasswordPath
: Custom URL for password update pageresendAuthPath
: Custom URL for resend verification pageresetAuthPath
: Custom URL for password reset pagedata-customization
: JSON string containing layout and styling customizationsaction
: Authentication action (optional if URL contains action)action
attribute is provided in the script tag. It will scan the URL for any of the valid actions (signin
, signup
, verify
, reset
, update
, resend
).
https://example.com/auth/signup
, the widget will show the signup formhttps://example.com/verify?token=abc123
, the widget will show the verification formhttps://example.com/auth#reset
, the widget will show the password reset formaction
attribute, the attribute in the script tag takes precedence.data-customization
attribute, you can directly style the widget elements using CSS selectors. The widget uses specific class names that you can target in your stylesheets:
CSS Class | Element | Description |
---|---|---|
.authiqa-container | Main container | The outer container of the widget |
.authiqa-title | Title | The main heading (h1) of the form |
.authiqa-input | Input fields | All input fields (email, password, etc.) |
.authiqa-button | Submit button | The main action button |
.authiqa-password-container | Password field wrapper | Container for password input and toggle |
.password-toggle | Password visibility toggle | Button to show/hide password |
.authiqa-error | Error message | Container for error messages |
.authiqa-success | Success message | Container for success messages |
.authiqa-form | Form element | The form element containing inputs |
.authiqa-label | Input labels | Labels above input fields |
.authiqa-labeled-input | Label+input container | Container for label and input pairs |
.terms-container | Terms checkbox area | Container for terms and conditions checkbox and text |
!important
flag to ensure your styles override the default styles. For more complex customizations, you can use the disable-styles="true"
attribute and apply your own styles from scratch.data-customization
attribute:
for
attribute for improved accessibility. This allows users to click on labels to focus the corresponding input field and improves screen reader compatibility.customization.inputs
object:
Property | Type | Description | Example |
---|---|---|---|
emailPlaceholder | string | Placeholder text for email input | ”Your work email” |
passwordPlaceholder | string | Placeholder text for password input | ”Create a strong password” |
usernamePlaceholder | string | Placeholder text for username input | ”Choose a username” |
confirmPasswordPlaceholder | string | Placeholder text for confirm password input | ”Re-enter your password” |
emailLabel | string | Label text for email input | ”Email Address” |
passwordLabel | string | Label text for password input | ”Password” |
usernameLabel | string | Label text for username input | ”Username” |
confirmPasswordLabel | string | Label text for confirm password input | ”Confirm Password” |
height | string | Height of input fields | ”48px” |
width | string | Width of input fields | ”100%“ |
padding | string | Padding inside input fields | ”12px 16px” |
margin | string | Margin around input fields | ”8px 0” |
fontSize | string | Font size of input text | ”16px” |
fontWeight | string | Font weight of input text | ”400” |
borderRadius | string | Border radius of input fields | ”8px” |
focusBorderColor | string | Border color when input is focused | ”#10D5C6” |
focusBoxShadow | string | Box shadow when input is focused | ”0 0 0 2px rgba(16, 213, 198, 0.25)“ |
placeholderAlign | string | Text alignment for placeholder text | ”left”, “center”, “right” |
for
attribute. This improves usability for screen readers and allows users to click on the label to focus the input field.preset
attribute on the script tag or programmatically via the widget API.
Supported presets:
customization
baseline that is deeply merged with your overrides.
data-customization
include:
successAuthPath
(or default success URL)https://github.com/login/oauth/authorize
client_id
, redirect_uri
, scope=read:user user:email
, and a signed state
payloadredirect_uri
uses your configured signinAuthPath
(or current page) because GitHub supports a single callbackcode
and state
, the widget detects the callback and exchanges the code via your API at /auth/github
successAuthPath
(or default success URL){organization_id}
with your actual organization ID and use your API token from the Authiqa dashboard.successAuthPath
state
parametersigninAuthPath
(or page URL) exactly matches the GitHub App callback URLstate
parameter/auth/github
signinAuthPath
(or current page) for redirectstate
parameter and validates it on returnsuccessAuthPath
state
parameter server-side/auth/github
endpoint returns JSON with { success: true, token, user, jwtSecret }
on successsuccessAuthPath
or the API-provided success URLsessionStorage
and removes it after handling the callbackSetting | Where | Value |
---|---|---|
Client ID | GitHub OAuth App | YOUR_GITHUB_CLIENT_ID |
Client Secret | GitHub OAuth App | YOUR_GITHUB_CLIENT_SECRET |
Authorization callback URL | GitHub OAuth App | e.g., https://yourdomain.com/auth/signin |
signinAuthPath | Widget attribute | Path or absolute URL for callback page |
successAuthPath | Widget attribute | Post-auth redirect destination |
enable-google-one-tap
attribute:
yourdomain.com
)yourdomain.com
with your actual domain. Include both www
and non-www
versions if you use both. Always include the Authiqa callback URL: https://api.authiqa.com/auth/google/callback
123456789-abcdefghijklmnop.apps.googleusercontent.com
{organization_id}
with your actual organization ID, and use your API token. You can find these values in your Authiqa dashboard.https://api.authiqa.com/auth/google/callback
enable-google-one-tap
attribute:
enable-google-one-tap="false"
to completely disable One Tap while still showing the Google Sign-In buttonwidget.resetGoogleOneTap()
when a user signs out to allow One Tap to appear again in the same sessionwidget.cleanup()
when removing the widget from the DOM to ensure One Tap is properly dismissedSetting | Value | Notes |
---|---|---|
API | Google+ API | Must be enabled |
OAuth Consent Screen | Configured with your app details | Include your domain in authorized domains |
Application Type | Web application | Required for web-based authentication |
JavaScript Origins | Your domain(s) + localhost for testing | Include both www and non-www versions |
Redirect URIs | Your domain(s) + Authiqa callback | Must include https://api.authiqa.com/auth/google/callback |
successAuthPath
if providedverifyAuthPath
: Used in verification emails (signup and resend)updatePasswordPath
: Used in password reset emailsverifyAuthPath
and updatePasswordPath
are particularly important as they determine the URLs in authentication emails:verifyAuthPath
+ verification tokenupdatePasswordPath
+ reset tokenindex.html
):
vite.config.js
:
Prop | Type | Required | Default | Description |
---|---|---|---|---|
publicKey | string | Yes | - | Your Authiqa public key |
action | string | No | ”signin” | Authentication action (“signin”, “signup”, “reset”, “verify”, “update”, “resend”) |
theme | string | No | ”light” | Widget theme (“light”, “dark”) |
mode | string | No | ”popup” | Display mode (“popup”, “inline”) |
container | string | Yes | ”authiqa-react-container” | Container ID |
onSuccess | function | No | - | Callback when authentication succeeds |
onError | function | No | - | Callback when authentication fails |
customization | object | No | - | Custom styling options (colors, typography, layout) |
termsAndConditions | string | No | - | URL to terms and conditions |
privacy | string | No | - | URL to privacy policy |
notificationSettings | string | No | - | URL to notification settings |
verifyAuthPath | string | No | - | Path for email verification |
updatePasswordPath | string | No | - | Path for password update |
resendAuthPath | string | No | - | Path for resending verification |
successAuthPath | string | No | - | Path for success redirect |
signinAuthPath | string | No | - | Path for sign-in redirect |
customization
prop accepts an object with the following structure:
onSuccess
, onError
)customization
prop to override default styles or apply CSS targeting the widget containerglobal-config.js
) with your customization settingswindow.AuthiqaGlobalConfig
object and is loaded before the widget script.window.AuthiqaGlobalConfig
object with two main sections:
customization
: Contains all styling and layout optionsmessages
: Contains custom success and loading messagesdata-customization
attribute, including:
#signin
), it will show the corresponding formaction
attribute from the script tagaction
attribute while still enabling hash-based navigation.
Hash | Form Displayed |
---|---|
#signin | Sign In form |
#signup | Sign Up form |
#verify | Email Verification form |
#reset | Password Reset form |
#update | Password Update form |
#resend | Resend Confirmation form |
data-public-key
: Your public keytheme
: Widget theme settingenable-google-one-tap
: Google One Tap configuration#signin
becomes signin
)