A React UI component library for LuminAIR proof verification. This library provides a customizable verifier button component that allows users to verify LuminAIR STARK proofs directly in their browser.
npm install @gizatech/luminair-react
For Next.js projects, you need to configure webpack to handle WASM files and import the CSS:
- Import the CSS in your main layout or page:
import '@gizatech/luminair-react/styles.css';
- Configure Next.js for WASM support:
Important: If you're using Next.js 15+ with Turbopack (--turbopack
flag), you should disable it for better WASM compatibility. Change your dev script in package.json
:
{
"scripts": {
"dev": "next dev"
}
}
Then create or update your next.config.js
or next.config.ts
:
TypeScript (next.config.ts
):
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
webpack: (config, { isServer }) => {
// Handle WASM files
config.experiments = {
...config.experiments,
asyncWebAssembly: true,
};
// Handle .wasm files
config.module.rules.push({
test: /\.wasm$/,
type: "webassembly/async",
});
// Fallback for Node.js modules in client-side
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
crypto: false,
};
}
return config;
},
};
export default nextConfig;
JavaScript (next.config.js
):
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config, { isServer }) => {
// Handle WASM files
config.experiments = {
...config.experiments,
asyncWebAssembly: true,
};
// Handle .wasm files
config.module.rules.push({
test: /\.wasm$/,
type: 'webassembly/async',
});
// Fallback for Node.js modules in client-side
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
crypto: false,
};
}
return config;
},
};
module.exports = nextConfig;
- Use the component:
import { VerifyButton } from '@gizatech/luminair-react';
export default function Home() {
return (
<VerifyButton
proofPath="/proof.bin"
settingsPath="/settings.bin"
/>
);
}
import { VerifyButton } from '@gizatech/luminair-react';
import '@gizatech/luminair-react/styles.css';
function App() {
return (
<VerifyButton
proofPath="/path/to/proof.bin"
settingsPath="/path/to/settings.bin"
/>
);
}
import { VerifyButton } from '@gizatech/luminair-react';
import '@gizatech/luminair-react/styles.css';
function App() {
return (
<VerifyButton
proofPath="/proof.bin"
settingsPath="/settings.bin"
title="Custom Verification Title"
buttonText="VERIFY PROOF"
author="Your Organization"
modelDescription="Custom AI Model"
authorUrl="https://yourwebsite.com"
className="custom-button-styles"
/>
);
}
Prop | Type | Required | Default | Description |
---|---|---|---|---|
proofPath |
string |
✅ | - | Path to the proof file |
settingsPath |
string |
✅ | - | Path to the settings file |
title |
string |
❌ | "Can't be evil." |
Title displayed in the modal |
buttonText |
string |
❌ | "VERIFY" |
Text displayed on the button |
author |
string |
❌ | "Giza" |
Author name displayed in the modal |
modelDescription |
string |
❌ | "Demo model" |
Model description displayed in the modal |
authorUrl |
string |
❌ | "https://www.gizatech.xyz/" |
Author URL for the link |
className |
string |
❌ | - | Custom CSS classes for the button |
- 🔒 Secure: Verification happens entirely in the browser
- 🎨 Customizable: All text and styling can be customized
- 📱 Responsive: Works on desktop and mobile devices
- 🌙 Dark Mode: Built-in dark mode support
- ⚡ Fast: Optimized for performance
- 📦 Lightweight: Minimal bundle size
The component uses Tailwind CSS for styling. Make sure your project has Tailwind CSS configured, or the styles will not work properly.
The component relies on CSS custom properties for theming. These are included in the imported CSS file, but you can override them:
:root {
--background: 0 0% 100%;
--foreground: 0 0% 3.9%;
--border: 0 0% 89.8%;
/* ... other variables */
}
.dark {
--background: 0 0% 3.9%;
--foreground: 0 0% 98%;
--border: 0 0% 14.9%;
/* ... other variables */
}
This library requires the following peer dependencies:
-
react
>= 16.8.0 -
react-dom
>= 16.8.0
- Chrome/Edge 88+
- Firefox 78+
- Safari 14+
If you encounter WASM-related errors in Next.js:
-
Disable Turbopack: Remove
--turbopack
from your dev script inpackage.json
- Make sure you've configured
next.config.js
as shown above - Ensure your proof files are in the
public/
directory - Clear cache and restart:
rm -rf .next && npm run dev
If styles are not applied:
- Make sure you're importing the CSS:
import '@gizatech/luminair-react/styles.css'
- Verify Tailwind CSS is configured in your project
- Check that CSS custom properties are defined
-
Module not found: Can't resolve 'luminair_web_bg.wasm'
→ Configure Next.js webpack and disable Turbopack -
Module not found: Can't resolve '@gizatech/luminair-react/styles.css'
→ Update to latest version and use correct import path
MIT
Contributions are welcome! Please read our contributing guidelines before submitting a PR.
For support, please open an issue on GitHub or contact us at support@gizatech.xyz.