Nexus Documentation
🤖 AI Widget ⚡ Groq Powered 🔒 Zero-Trust 📊 1,000 req/mo Free

Nexus Web Assistant v3.0

Turn any webpage into a conversational knowledge base. Embed in seconds, secure by design.

Nexus Web Assistant is a lightweight, embeddable AI chat widget that automatically scrapes your page content, understands the context, and answers user questions using Groq's ultra-fast LLMs — all while keeping your API keys strictly secure through encryption and domain whitelisting.

Security First — Your Groq key is never exposed.

You store your Groq API key in the encrypted dashboard vault. The widget uses a separate, domain-restricted Nexus key for communication. Our proxy validates the domain, decrypts your Groq key, and forwards requests — your original key never touches the client's browser.

🚀 Quick Start

Embed the Nexus widget on your website in four simple steps.

1

Get your Nexus API Key

Sign in to the Nexus Dashboard. In the Nexus Keys tab, click "New Key", give it a name (e.g., "Production Website"), and copy the generated key. This key is safe to embed in your HTML.

2

Store your Groq API Key

In the Dashboard, navigate to the Settings tab. Paste your Groq API key into the Groq Configuration section and click "Save Changes". Your key is securely encrypted and never exposed.

3

Whitelist your Domain

In the Dashboard, go to the Domains tab. Add your website domain (e.g., example.com). Only whitelisted domains can use your Nexus API key.

4

Add the script tag

Paste the following code into your HTML, preferably just before the closing </body> tag.

<script>
window.NexusConfig = {
  apiKey: 'YOUR_NEXUS_API_KEY',
  model: 'meta-llama/llama-4-scout-17b-16e-instruct',
  botName: 'Nexus AI',
  greeting: '👋 Hello! How can I assist you today?'
};
</script>

<script defer src="https://cdn.jsdelivr.net/npm/nexus-web-assistant@3.0.0/dist/nexus-assistant.min.js"></script>

That's it! Your website now has an AI assistant that understands its content. Users can ask questions and get instant, context-aware answers. See it in action on the Live Demo page.

⚙️ Configuration Options

Customize the widget's behaviour by setting the window.NexusConfig object before the script loads. All properties are optional except apiKey.

Property Type Default Description
apiKey Required string '' Your Nexus API key generated from the Dashboard.
model string 'llama-4...' Groq model to use. e.g. llama3-8b-8192.
botName string 'Nexus AI' Display name of the assistant header.
greeting string Default Welcome Initial bot message. Supports Markdown format.
systemPrompt string Internal Routine Override system instructions for the AI behavior.
theme enum 'auto' Accepts dark, light, or auto (detects from website).

Example Configuration

window.NexusConfig = {
  apiKey: 'nxs_abc123def456',
  model: 'llama3-70b-8192',
  botName: 'DocBot',
  greeting: '📚 Welcome to our docs! Ask me anything.',
  systemPrompt: 'You are a helpful assistant. Cite sources.',
  theme: 'dark'
};

System Prompt Tip: Your custom prompt is appended to the page context. The AI will always prioritize the page content over general knowledge.

🔌 Framework Integrations

Nexus works seamlessly with every major frontend framework. Visit the Integrations page for framework-specific code snippets.

⚛️ React
🟢 Vue
🔴 Angular
Next.js
🚀 Astro
🟠 Svelte

Plus WordPress, Shopify, Webflow, Laravel, Vite, Gatsby, Remix, and more. See full list →

🎨 Theming

Nexus automatically adapts to your website's theme, but you can also force a specific mode or let users toggle it.

Auto-detection Engine

By default (theme: 'auto'), the widget tracks visual context signals in this sequential order:

  1. Explicit execution setup via window.NexusConfig.theme
  2. Cached environment flag matching persistent state indicators inside localStorage
  3. Active style presence configurations (checking for structural dark or light class hooks inside your document markup roots)
  4. Checking data targets via the custom fallback property selector attribute configurations data-theme
  5. System level device preferences monitored through native query execution wrappers prefers-color-scheme

Pro Tip: The embedded proxy layers also automatically sync brightness thresholds out of active meta declarations like <meta name="theme-color"> configurations to infer custom matching setups instantly.

✨ Key Features

Context Scraping

Extracts clean Markdown from your page content — headings, paragraphs, lists, and code snippets.

File Attachments 5MB Max

Users can attach images, PDFs, text files, and Word documents securely via the widget interface.

SPA Support

Automatically detects navigation changes in single-page apps and refreshes the page context dynamically.

Smart Caching 24h TTL

Scraped content is cached in IndexedDB. Repeat visitors get instant responses without re-scraping.

🔐 Security Model

Nexus is built with a zero-trust approach to API key management. Here's how your keys are protected:

1

You store your Groq API key in the Dashboard

Your key is encrypted with AES-256 before being saved to Firestore. Only you can view or delete it.

2

You generate a Nexus API key

This key is safe to embed in your HTML. It is domain-restricted — it only works for origins you authorize.

3

The widget sends your Nexus key to our proxy

The proxy validates the domain, decrypts your Groq key, and securely forwards the request to Groq's servers.

🔧 Advanced Customization

Styling Overrides

Customize the widget's appearance by overriding targeted layout variables mapped straight on the custom identity layer selector target parameter #ai-widget-root.

#ai-widget-root {
  --bg-panel: rgba(10, 10, 10, 0.92);
  --text-primary: #eee;
  --accent: #a855f7;
  --send-bg: #a855f7;
  --send-color: #fff;
  --user-bubble-bg: #2a2a2e;
  --bot-bubble-bg: #1a1a1e;
  --border-color: rgba(255, 255, 255, 0.06);
}

Programmatic API Control

The widget ecosystem injects flexible custom methods straight inside the window browser context container layer. Execute these methods directly within local custom application files:

Method Hook Call Execution Description
window.openNexus() Opens the active interactive chat interface overlay.
window.closeNexus() Collapses the active visible assistant panel container framework.
window.toggleNexus() Toggles open or closed visual threshold state layers programmatically.
window.refreshNexusContext() Forces a complete, fresh re-scrape execution layer sync over current layout contexts.

🔌 API Reference

The embedded script interfaces secure communications down your secure proxy entry paths matching endpoint layouts at POST /api/chat. Expected processing payloads follow this structural format:

{
  "nexusKey": "nxs_abc123def456",
  "messages": [
    { "role": "system", "content": "You are a helpful assistant..." },
    { "role": "user", "content": "What is this page about?" }
  ],
  "model": "meta-llama/llama-4-scout-17b-16e-instruct"
}

🧪 API Playground

The Nexus Playground is a live testing environment where you can send requests to the API using your own keys — with zero configuration.

Test Your Own Keys

Select any of your active Nexus keys, choose a model, enter a message, and inspect the raw JSON response — including status, latency, and token usage.

No setup Your session only Domain whitelist bypassed

⚠️ Error Codes

Common HTTP status codes returned by the Nexus proxy and their meanings:

Code Meaning Solution
400 Bad Request Check your messages array and ensure all required fields are present.
401 Unauthorized Verify your apiKey in window.NexusConfig.
403 Forbidden Add your domain to the Domains tab in the dashboard.
429 Too Many Requests Upgrade your plan or wait for the next monthly reset (1,000 requests/month for free tier). See Pricing for details.
500 Internal Server Error Ensure your Groq API key is correctly set in the Settings tab.

❓ Troubleshooting & FAQ

Common issues and frequently asked questions.

Widget is not showing up on my page.

Ensure window.NexusConfig.apiKey is set correctly. Check the browser console for errors. Also verify that your domain is whitelisted in the Dashboard → Domains.

I get a 403 Forbidden error.

Your domain is not authorized. Go to the Dashboard → Domains tab and add your exact website domain (e.g., example.com).

How do I clear the chat history?

Click the trash icon in the widget header. This clears the current session and resets the conversation. History is stored locally in your browser's localStorage.

What happens when I hit the free tier limit?

Once you exceed 1,000 requests in a month, the API will return a 429 Too Many Requests error. Usage resets on the 1st of every month. Upgrade your plan for higher limits.

📊 System Status

Monitor the health of the Nexus platform in real time. The Status Page provides uptime metrics, service latencies, and incident history.

99.99%
Global Uptime
<200ms
Avg Response
24/7
Monitoring

Status page updates automatically every 30 seconds. All incidents are documented with timestamps.

🖥️ Self-Hosting

Since Nexus is open-source (MIT), you can self-host the widget and backend entirely on your own infrastructure.

git clone https://github.com/thekaifansari01/NexusWeb.git
cd NexusWeb

npm install
npm run build

For backend self-hosting, refer to the api/ directory and vercel.json for serverless deployment configurations.

🆘 Support

Need help? We've got you covered.

GitHub Issues

Report bugs, request features, or contribute to the open-source codebase.

Open Repository →

Email Support

Direct contact for urgent deployment queries and enterprise support.

kaif.ansari.global@gmail.com