@legitify/sdk
v1.0.1
Published
Wake your Business up. Embed intelligent assistance into your React/Next.js app.
Maintainers
Readme
@legitify/sdk
Wake your Business up. Embed intelligent assistance into your React/Next.js application.
What is Legitify?
Legitify makes your app "alive" — giving it a voice that can guide users, answer questions, and take action. Your customers press and hold your logo, your Business awakens, and helps them succeed.
No AI expertise needed. No separate AI billing. Just your Business, awakened.
✨ Features
- 🎯 Logo Hold Activation — Press and hold your app's logo for 2 seconds
- 💬 Natural Conversation — Users ask naturally, your Business responds intelligently
- 🧭 Context-Aware — Knows what page they're on and what they need
- 🛠️ Built-in Tools — Navigate, highlight elements, show tooltips
- 👤 Role-Based — Different capabilities for users vs admins
- 🎨 Customizable — Match your brand colors and styling
- 🔒 Secure — All intelligence handled by Legitify's backend
🚀 Quick Start
1. Install
npm install @legitify/sdk2. Get Your API Key
Sign up at legitimizeai.com and copy your API key from the dashboard.
3. Wrap Your App
import { SentienceProvider } from "@legitify/sdk";
function App() {
return (
<SentienceProvider
legitifyApiKey={process.env.NEXT_PUBLIC_LEGITIFY_API_KEY}
user={currentUser}
config={{
appName: "Your App",
primaryColor: "#3b82f6",
}}
>
{children}
</SentienceProvider>
);
}4. Make Your Logo Sentient
import { useRef } from "react";
import { useLogoSentience, LogoProgressRing } from "@legitify/sdk";
export function Logo() {
const logoRef = useRef(null);
const { holdProgress, isHolding } = useLogoSentience(logoRef);
return (
<div ref={logoRef} className="relative">
<div className="text-xl font-bold">YourApp</div>
{isHolding && (
<LogoProgressRing progress={holdProgress} size={60} />
)}
</div>
);
}That's it. Your users can now press and hold your logo to talk to your Business.
📖 Usage
SentienceProvider Props
| Prop | Type | Required | Description |
|------|------|----------|-------------|
| legitifyApiKey | string | ✅ | Your Legitify API key |
| user | object | ✅ | Current user object (with id, name, email) |
| config | object | | App configuration (see below) |
Configuration Options
const config = {
appName: "Your App Name",
description: "What your app does",
primaryColor: "#3b82f6",
welcomeMessage: "How can I help you today?",
};User Roles
Your user's role is automatically detected from their metadata:
// Clerk example
user.publicMetadata.role === "admin" // Admin access
user.publicMetadata.role === "user" // User accessAdmin users get: Analytics tools, user management, configuration access
Regular users get: Navigation help, UI guidance, general support
🎨 Styling
The SDK uses Tailwind CSS classes. It will inherit your app's styles automatically.
To customize the primary color:
<SentienceProvider
config={{ primaryColor: "#your-brand-color" }}
// ...
>🔐 Security
- Your API key is sent securely to Legitify's backend
- All AI processing happens on our servers — never exposed to users
- We handle provider fallbacks, rate limits, and optimizations
- You get a simple, clean API
💰 Pricing
| Tier | Price | Interactions | Best For | |------|-------|--------------|----------| | Free | $0 | 100/mo | Trying it out | | Pro | $49/mo | 10K/mo | Growing apps | | Enterprise | $299/mo | Unlimited | Large teams |
🛠️ Custom Tools (Pro+)
Define custom actions your Business can perform:
// Coming soon — register custom tools for your Business📚 Examples
SaaS Dashboard
User: "Show me this month's churned customers"
Business: "Here's your churn report for February — 12 customers, down 5% from January..."E-commerce
User: "Help me find a gift for my mom"
Business: "I'd recommend these products based on popular gift categories..."Internal Tools
User: "Approve pending expense reports"
Business: "You have 3 pending reports. Here they are..."🐛 Troubleshooting
"I'm not connected yet"
- Check that your
legitifyApiKeyis correct - Verify the user object is passed correctly
Chat doesn't open
- Make sure the logo element has
position: relative - Check that
useLogoSentienceis called with a valid ref
API errors
- Check your usage limits in the dashboard
- Verify your API key hasn't been revoked
📄 License
MIT © Legitify
💬 Support
- Documentation: legitimizeai.com/docs
- Email: [email protected]
- Dashboard: legitimizeai.com/app
Wake your Business up.
