
Serve multiple dynamic webpages from a single URL! A React and Next.js package that uses custom "unseen" tags to transform text and UI dynamically using AI, with support for UTM parameters, user information, and theme customization.
๐ Dynamic Transformation
Transform text content in real-time using advanced AI models
๐ฏ UTM Parameter Support
Customize content based on marketing campaign parameters
๐จ Customizable Prompts
Define your own transformation rules and styles
โก๏ธ Real-time Updates
Instant content adaptation without page reloads
๐ Secure API Handling
Safe and secure API key management
๐ญ Multiple AI Models
Support for OpenRouter and Google Gemini APIs
โ๏ธ React Version Support
Full support for React 16.8.0 and above, including React 19
๐จ Theme Customization
Customize colors, fonts, and styles for transformed content
๐ค User Information
Access device type, platform, and language preferences
- Currently at version 2.2.1 with full React compatibility
- Supports React 16.8.0 and all subsequent versions
- Fully compatible with React 17, 18, and 19
- Works seamlessly with Next.js applications
- Regular updates to maintain compatibility with the latest React features
Installation
Choose your preferred package manager to install NotSoUnusual:
API Keys Setup
You'll need API keys from one of the supported AI providers:
OpenRouter API Key
- Visit OpenRouter.ai
- Create an account and get your API key
- Add it to your environment variables
Google Gemini API Key
- Visit Google AI Studio
- Create a new project and enable the Gemini API
- Generate your API key
Quick Start
Get up and running with NotSoUnusual in just a few steps:
1. Basic Text Transformation
import { UnseenProvider, Unseen } from 'notsounusual';
function App() {
return (
<UnseenProvider
useGemini={true}
geminiApiKey="YOUR_GEMINI_API_KEY" // Get from https://makersuite.google.com/app/apikey
customPrompt={"Change the text to hello user, do not return anything else just say hello user"} // change this as per your need!
>
<h1>
<Unseen>This text will be transformed by AI</Unseen>
</h1>
</UnseenProvider>
);
}
2. Custom Prompts for Campaign-Specific Transformations
import { UnseenProvider, Unseen } from 'notsounusual';
function App() {
const getCustomPrompt = (utmConfig) => {
// Default prompt for banking solutions
const defaultPrompt = `
Transform this into a banking solutions page with the following theme:
- Heading: Modern banking solutions
- Button colors: #1976d2 (primary), #dc004e (secondary)
- Hover effects: Slight scale and shadow
- Links: Banking solutions, Loans, Credit cards
- Important: Maintain the structure and design
`;
// Campaign-specific prompts
const campaignPrompts = {
home_loans: `
Transform this into a home loans page with the following theme:
- Heading: Your dream home is closer than you think
- Button colors: #2e7d32 (primary), #c62828 (secondary)
- Hover effects: Elevation and color shift
- Links: Home loans, Mortgage calculator, Apply now
- Important: Focus on home ownership benefits
`,
credit_cards: `
Transform this into a credit cards page with the following theme:
- Heading: Rewards that match your lifestyle
- Button colors: #1565c0 (primary), #d32f2f (secondary)
- Hover effects: Glow and scale
- Links: Credit cards, Rewards, Apply now
- Important: Emphasize rewards and benefits
`,
investment: `
Transform this into an investment page with the following theme:
- Heading: Grow your wealth with smart investments
- Button colors: #0277bd (primary), #c2185b (secondary)
- Hover effects: Smooth transition and shadow
- Links: Investments, Portfolio, Get started
- Important: Focus on growth and security
`
};
// Return campaign-specific prompt or default
return campaignPrompts[utmConfig?.campaign] || defaultPrompt;
};
return (
<UnseenProvider
useGemini={true}
geminiApiKey="YOUR_GEMINI_API_KEY" // Get from https://makersuite.google.com/app/apikey
customPrompt={getCustomPrompt}
>
<div>
<Unseen transformUI={true}>
<button className="cta-button">
Click me to transform
</button>
</Unseen>
</div>
</UnseenProvider>
);
}
3. UI Transformation with Theme
import { UnseenProvider, Unseen } from 'notsounusual';
function App() {
const themeConfig = {
colors: {
primary: '#1976d2',
secondary: '#dc004e',
background: '#ffffff',
text: '#333333',
accent: '#4caf50',
},
typography: {
fontFamily: 'Roboto, sans-serif',
fontSize: '16px',
fontWeight: '400',
},
spacing: {
small: '8px',
medium: '16px',
large: '24px',
},
borderRadius: '4px',
shadows: '0 2px 4px rgba(0,0,0,0.1)',
};
return (
<UnseenProvider
useGemini={true}
geminiApiKey="YOUR_GEMINI_API_KEY" // Get from https://makersuite.google.com/app/apikey
themeConfig={themeConfig}
>
<div>
<Unseen transformUI={true}>
<button className="cta-button">
Click me to transform
</button>
</Unseen>
</div>
</UnseenProvider>
);
}
- Initialize UTM parameters state with empty values
- Extract UTM parameters from the URL on component mount
- Use environment variables for API keys
- Declare UTM parameters in the custom prompt using template literals
- Provide default content when no UTM parameters are present'
Example: Landing Page Prompt (Gemini)
Here's the actual prompt used in our landing page for the Gemini model:
customPrompt={`You may or may not receive UTM parameters
UTM Parameters: ${JSON.stringify(utmConfig)}
If no UTM parameters are present, return only the default homepage heading
homepage heading: notsounusual โ where UI evolves quietly
if no utm parameters are there then do not generate any of the following
If a utm_source is present, return one thing and nothing else โ no explanations, no labels
1. A short greeting with one or two sentences, tailored to the utm_source value
- linkedin โ Looks like you're deep in discovery mode on LinkedIn โ love that. Let's show you something just as smart
- whatsapp โ Caught you sneaking in from WhatsApp โ no judgments, only cool UIs ahead
- producthunt โ Product Hunter detected โ clearly you know where to look for what's next. Let's make UI feel fresh again`}
- First declares that UTM parameters may be present
- Shows the current UTM parameters using JSON.stringify
- Provides a default heading for when no UTM parameters are present
- Includes specific responses for different UTM sources (LinkedIn, WhatsApp, ProductHunt)
- Uses clear formatting and instructions optimized for Gemini's response style
API Keys Setup
NotSoUnusual supports two AI models for text transformation. We recommend using Google's Gemini API for the best performance and reliability. Both options are free to use with certain limitations.
Google Gemini
Uses Google's Gemini 2.0 Flash model, offering superior performance and reliability for text transformation.
- Best-in-class text generation quality
- Consistent and reliable responses
- Faster response times
- Better context understanding
- Google Cloud integration
- Generous free tier
Setup Steps:
- Visit Google AI Studio
- Sign in with your Google account
- Create a new project
- Enable the Gemini API
- Generate your API key
OpenRouter (Meta Llama)
Uses Meta's Llama 3.3 8B Instruct model, providing an alternative option for text generation.
- Free to use with rate limits
- 128,000 context window
- No credit card required
- Good for testing and development
Setup Steps:
- Visit OpenRouter API
- Create a free account
- Generate your API key
- Add it to your environment variables
- We recommend using Google Gemini for production applications due to its superior performance and reliability
- Both APIs are free to use with certain rate limits
- Google Gemini requires a Google Cloud account but offers a generous free tier
- OpenRouter is a good alternative for testing and development
- Keep your API keys secure and never expose them in client-side code
# .env.local (for Next.js)
REACT_APP_OPENROUTER_API_KEY=your_openrouter_api_key_here
REACT_APP_GEMINI_API_KEY=your_gemini_api_key_here
AI Models
NotSoUnusual supports two powerful AI models for text transformation:
OpenRouter
Uses the meta-llama/llama-3.3-8b-instruct:free model, providing high-quality text generation with context-aware responses and support for complex prompts.
- Free to use with rate limits
- 128,000 context window
- No credit card required
- Good for testing and development
Gemini
Uses Google's gemini-2.0-flash model, offering fast response times, high-quality text generation, and advanced language understanding.
- Best-in-class text generation quality
- Consistent and reliable responses
- Faster response times
- Better context understanding
- Google Cloud integration
- Generous free tier
Marketing Use Cases
NotSoUnusual enables various marketing applications:
Dynamic Headlines
Generate different headlines based on traffic source
Personalized CTAs
Customize call-to-action text and appearance based on campaign
A/B Testing
Test different text and UI variations automatically
Campaign-Specific Content
Show different content and styling for different marketing campaigns
Channel-Specific Messaging
Adapt tone, style, and UI based on marketing channel
Device-Specific Content
Customize content and layout based on user's device and screen size
Language-Aware Content
Adapt content and UI based on user's language preferences
Test Application
The package includes a test application in the `test` directory that demonstrates the functionality of `notsounusual`.
Features
- UTM parameter selection interface
- Real-time prompt preview
- Dynamic heading generation
- Error handling demonstration
- Theme customization examples
- UI transformation demos
Running the Test App
# Navigate to test directory
cd test
# Install dependencies
npm install
# Create .env file with your API keys
REACT_APP_GEMINI_API_KEY=your_gemini_api_key_here
REACT_APP_OPENROUTER_API_KEY=your_openrouter_api_key_here
# Start the development server
npm start
API Implementation
OpenRouter API
fetch("https://openrouter.ai/api/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer <OPENROUTER_API_KEY>",
"HTTP-Referer": "<YOUR_SITE_URL>",
"X-Title": "<YOUR_SITE_NAME>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"model": "meta-llama/llama-3.3-8b-instruct:free",
"messages": [
{
"role": "user",
"content": "What is the meaning of life?"
}
]
})
});
Gemini API
fetch(
`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=${GEMINI_API_KEY}`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
contents: [
{
parts: [
{
text: `${customPrompt}\n\nText to transform: ${text}`
}
]
}
]
})
}
);
Gemini API is recommended for better performance and reliability:
- Faster response times
- More accurate transformations
- Better context understanding
- Cost-effective
- No rate limiting issues
- Better support for complex UI transformations
License
MIT License
Copyright (c) 2025 PriyanshuDas01
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
1. The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
2. Credit must be given to the original author by including a visible
acknowledgment to **PriyanshuDas01** in the README or documentation
of any project that uses or builds upon this Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- Free to use, modify, and distribute
- Must include copyright notice and permission notice
- Must give credit to PriyanshuDas01 in documentation
- No warranty provided
- No liability for damages
Support
Package Support
For issues related to the NotSoUnusual package, please open an issue in the GitHub repository.
- Package version
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment details
- API key configuration
- Any error messages or logs
Developer Support
For questions about implementation, customization, or best practices:
Documentation
Comprehensive guides and examples for implementation
- Installation guides
- API reference
- Code examples
- Best practices
Community
Join our developer community for support
- GitHub Discussions
- Stack Overflow
- Discord channel
- Code snippets
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- React 16.8.0 and above
- React 17.x
- React 18.x
- React 19.x
Props
UnseenProvider Props
Prop | Type | Description |
---|---|---|
geminiApiKey | string | Your Gemini API key (required for Gemini) |
apiKey | string | Your OpenRouter API key (required for OpenRouter) |
useGemini | boolean | Set to true to use Gemini API (recommended) |
customPrompt | string/function | Optional custom prompt or function that returns a prompt based on UTM config |
utmConfig | UtmConfig | Optional UTM parameters (overrides URL parameters) |
themeConfig | ThemeConfig | Optional theme configuration for UI transformation |
Unseen Props
Prop | Type | Description |
---|---|---|
children | ReactNode | The content to be transformed |
transformUI | boolean | Enable UI transformation (default: false) |
componentId | string | Optional component identifier |
componentName | string | Optional component name |
UTM Integration
NotSoUnusual supports all standard UTM parameters for marketing customization:
utm_source
Traffic source (e.g., facebook, google)
utm_medium
Marketing medium (e.g., social, email)
utm_campaign
Campaign name
utm_content
Content identifier
utm_term
Search terms
- Browser Information:
- Device type (mobile/desktop/tablet)
- Platform (OS)
- Language preferences
- Screen resolution
- Session Information:
- Entry page
- Referrer URL
- Session start time
- Geographic Information:
- Timezone