Customization & Theming
The Dataspike Web SDK can be fully customized to align with your product’s look and feel.You can modify colors, fonts, and typography, and handle user events through callback functions.
💡 Theming and event callbacks let you deliver a seamless, branded verification experience that feels native to your product.
Event Callbacks
The widget provides lifecycle callbacks that help you manage user flow and system events.Theming Overview
You can override the default design by passing a theme object when initializing the widget. Themes can adjust colors, typography, and visual hierarchy to match your brand guidelines.| Callback | Description |
|---|---|
onInit | Invoked when the widget loads. Provides the current verification status and any initialization errors. |
onFinish | Triggered when the user completes the verification flow. Use this to update the UI or trigger backend actions (e.g., updating applicant status). |
⚙️ Tip: You can dynamically load theme presets for light or dark modes based on user preferences.
Theme Properties
| Property | Type | Description |
|---|---|---|
palette | object | Controls the widget’s color palette including text, background, and accent tones. |
typography | object | Configures font family, size, weight, and line height for different text elements. |
palette.primaryA1 | string | Primary brand color used for buttons and interactive highlights. |
palette.textMain | string | Main text color used for headings and labels. |
typography.h1.fontSize | string | Font size for main headings (e.g., 48px). |
typography.fontFamily | string | Base font family applied throughout the widget. |
Example: Full Custom Theme
Debugging & Troubleshooting
If the widget does not render or behaves unexpectedly, check the following:-
Validate the
verificationUrlId.
Make sure it’s created correctly on your backend and returned to the frontend. -
Inspect the browser console.
Look for JavaScript errors or missing module imports. -
Verify the container element.
Ensure that the HTML element with the specifiedelementIdexists in the DOM before initializing the widget. -
Confirm API connectivity.
Check that the API endpoint (https://api.dataspike.ioor the Sandbox equivalent) is reachable from your environment.
🧩 Tip: Use the browser’s Network tab to monitor API requests triggered by the widget. This helps identify failed calls or CORS configuration issues.
Frequently Asked Questions
Q: Can I use the SDK in Sandbox mode?Yes — the Web SDK fully supports Sandbox mode. All verifications and webhooks return simulated data when initialized with the Sandbox API base URL. Q: Does theming affect verification logic?
No — theming only controls appearance. The verification process and logic remain unchanged. Q: Can I host the SDK myself?
Yes. You can install the package via NPM or Yarn, or host the static JS bundle from your own CDN if preferred.