npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@digilogiclabs/saas-factory-ai

v1.0.0

Published

Next.js 15 Compatible AI Integration Platform - Drop-in ready with server/client separation for seamless React Server Components support.

Readme

🤖 @digilogiclabs/saas-factory-ai

The Ultimate AI Integration Platform - From Simple to Enterprise

npm version TypeScript License: MIT

The most comprehensive AI integration library that provides robust and configurable ways to connect any project to all sorts of AI with both custom and turnkey solutions for all sorts of projects.

Why SaaS Factory AI?

🎯 4 Integration Levels - Choose Your Style

// 1. 🚀 Ultra-Simple (1 line)
const response = await simpleChat('Hello!', process.env.OPENAI_API_KEY);

// 2. ⚡ Quick Start (Project-specific)
const ai = quickStartAI({ 
  apiKey: 'your-key', 
  projectType: 'ecommerce' 
});

// 3. 🎯 Turnkey Solutions (Drop-in)
const chatbot = new AITurnkeyChatbot({
  personality: 'helpful and professional'
});

// 4. 🏢 Enterprise (Full control)
const enterpriseAI = createAIHub({
  providers: { /* multi-provider setup */ },
  routing: { strategy: 'quality' }
});

🌟 Key Features

  • 🎛️ Flexible Integration - From 1-line setup to enterprise configuration
  • 🤖 Multi-Provider AI - OpenAI, Anthropic, Google Gemini (Veo-3), custom providers
  • 📱 Cross-Platform - React, Next.js, React Native, Vue, Angular, Express, WordPress
  • 🎬 Video Generation - Veo-3 integration for realistic video creation
  • 🏭 Industry Presets - E-commerce, Healthcare, Education, Gaming, and more
  • 🔄 Intelligent Routing - Automatic provider selection by cost, speed, quality
  • 🛡️ Security First - No API keys in client code, JWT authentication
  • 📈 Production Ready - Usage quotas, rate limiting, monitoring, analytics

🚀 Quick Start

Installation

npm install @digilogiclabs/saas-factory-ai

Basic Usage

import { quickStartAI } from '@digilogiclabs/saas-factory-ai';

// Initialize AI for your project type
const ai = quickStartAI({
  apiKey: process.env.OPENAI_API_KEY,
  projectType: 'ecommerce' // Auto-configured for e-commerce
});

// Start chatting
const response = await ai.chat([
  { role: 'user', content: 'I need help finding a laptop for gaming' }
]);

React Integration

import { 
  AIProvider, 
  AIChat, 
  AITextGenerator, 
  AISetupStatus,
  getAIConfigFromEnv 
} from '@digilogiclabs/saas-factory-ai';

function MyApp() {
  const config = getAIConfigFromEnv();

  return (
    <AIProvider config={config}>
      <div className="p-6">
        <AISetupStatus />
        <AIChat placeholder="Ask me anything..." />
        <AITextGenerator 
          templates={['Blog post about', 'Email for']}
          maxLength={1000}
        />
      </div>
    </AIProvider>
  );
}

Environment Setup

Create a .env.local file with your AI provider keys:

# Choose one or more providers
NEXT_PUBLIC_OPENAI_API_KEY=sk-your-openai-key
NEXT_PUBLIC_ANTHROPIC_API_KEY=sk-ant-your-claude-key
NEXT_PUBLIC_GOOGLE_AI_API_KEY=your-gemini-key

# Optional gateway URL
NEXT_PUBLIC_AI_GATEWAY_URL=https://your-gateway.com

🧩 React Components

Ready-to-use UI components for common AI interactions:

AIChat - Complete Chat Interface

import { AIChat } from '@digilogiclabs/saas-factory-ai';

<AIChat 
  placeholder="Ask me anything..."
  showTypingIndicator={true}
  enableFileUpload={false}
  maxMessages={50}
  onMessageSent={(message) => console.log('Sent:', message)}
  onResponse={(response) => console.log('Received:', response)}
/>

AITextGenerator - Content Generation

import { AITextGenerator } from '@digilogiclabs/saas-factory-ai';

<AITextGenerator
  templates={['Blog post about', 'Product description for']}
  maxLength={1000}
  showWordCount={true}
  onGenerated={(text) => console.log('Generated:', text)}
/>

AIAudioGenerator - Audio Creation

import { AIAudioGenerator } from '@digilogiclabs/saas-factory-ai';

<AIAudioGenerator
  supportedFormats={['mp3', 'wav']}
  maxDuration={60}
  showWaveform={true}
  onGenerated={(audioUrl) => console.log('Audio:', audioUrl)}
/>

AIVideoGenerator - Video Creation

import { AIVideoGenerator } from '@digilogiclabs/saas-factory-ai';

<AIVideoGenerator
  resolution="1280x720"
  maxDuration={30}
  showPreview={true}
  onGenerated={(videoUrl) => console.log('Video:', videoUrl)}
/>

AISetupStatus - Configuration Status

import { AISetupStatus } from '@digilogiclabs/saas-factory-ai';

<AISetupStatus 
  showDetails={true}
  className="mb-4"
/>

📖 Documentation

Integration Guides

AI Capabilities

🎯 Industry Presets

Ready-to-use configurations for different sectors:

// E-commerce with product recommendations
const ecommerce = quickStartAI({ 
  projectType: 'ecommerce',
  capabilities: ['chat', 'embeddings', 'analysis']
});

// Healthcare with HIPAA compliance
const healthcare = quickStartAI({ 
  projectType: 'healthcare',
  environment: 'production',
  enableMonitoring: true
});

// Gaming with dynamic content
const gaming = quickStartAI({ 
  projectType: 'gaming',
  capabilities: ['chat', 'video', 'audio']
});

Available Presets: E-commerce, Healthcare, Education, Financial, Gaming, Content Creation, Customer Service, Developer Tools, Research

🤖 Turnkey Solutions

Drop-in AI features for immediate value:

import { 
  AITurnkeyChatbot, 
  AITurnkeyContentGenerator,
  AITurnkeyAnalyst 
} from '@digilogiclabs/saas-factory-ai';

// Smart customer service chatbot
const chatbot = new AITurnkeyChatbot({
  apiKey: process.env.OPENAI_API_KEY,
  personality: 'helpful and professional',
  features: ['sentiment-analysis', 'escalation-detection']
});

// Marketing content generator
const contentGen = new AITurnkeyContentGenerator({
  apiKey: process.env.OPENAI_API_KEY,
  contentTypes: ['blog', 'social', 'email'],
  brandVoice: 'friendly and informative'
});

// Business intelligence analyst
const analyst = new AITurnkeyAnalyst({
  apiKey: process.env.OPENAI_API_KEY,
  analysisTypes: ['sentiment', 'trends', 'predictions'],
  reportFormats: ['summary', 'detailed', 'executive']
});

🏢 Enterprise Features

Advanced capabilities for production deployments:

import { createAIHub } from '@digilogiclabs/saas-factory-ai';

const enterpriseAI = createAIHub({
  // Multi-provider configuration
  providers: {
    openai: { 
      capabilities: ['text.chat', 'embeddings'], 
      priority: 1,
      costWeight: 0.7
    },
    anthropic: { 
      capabilities: ['text.chat'], 
      priority: 2,
      costWeight: 0.8 
    },
    gemini: { 
      capabilities: ['video.generation'], 
      priority: 1
    }
  },

  // Intelligent routing
  routing: {
    strategy: 'quality', // or 'cost', 'speed'
    fallback: true,
    loadBalancing: true
  },

  // Production features
  features: {
    caching: { enabled: true, ttl: 1800 },
    rateLimiting: { enabled: true, requests: 10000 },
    monitoring: { enabled: true, metrics: ['cost', 'usage'] },
    security: { encryption: true, auditLogging: true }
  }
});

🎬 Video Generation (Veo-3)

Create realistic videos for training and content:

import { quickStartAI } from '@digilogiclabs/saas-factory-ai';

const ai = quickStartAI({
  apiKey: process.env.GOOGLE_API_KEY,
  primaryProvider: 'gemini' // For Veo-3 access
});

// Generate 8-second video
const videoJob = await ai.generateVideo(
  'A news anchor reporting on breaking technology news',
  {
    duration: 8, // Veo-3 limit
    resolution: '720p',
    style: 'news-broadcast'
  }
);

// Monitor progress
const { status, progress, result } = await ai.getJobStatus(videoJob.jobId);

🔧 Framework Integrations

Next.js App Router

// app/api/ai/chat/route.ts
import { createAIRoute } from '@digilogiclabs/saas-factory-ai/adapters';

export const { POST } = createAIRoute({
  apiKey: process.env.OPENAI_API_KEY,
  projectType: 'developer'
});

Express.js Middleware

import { aiMiddleware } from '@digilogiclabs/saas-factory-ai/adapters';

app.use(aiMiddleware({
  apiKey: process.env.OPENAI_API_KEY,
  projectType: 'customer-service'
}));

app.post('/chat', (req, res) => {
  const response = await req.ai.chat([
    { role: 'user', content: req.body.message }
  ]);
  res.json({ response });
});

React Native

import { quickStartAI } from '@digilogiclabs/saas-factory-ai/react-native';

const ai = quickStartAI({
  apiKey: process.env.OPENAI_API_KEY,
  projectType: 'content-creator'
});

// Mobile-optimized with polling instead of SSE
const response = await ai.chat([
  { role: 'user', content: 'Generate social media caption' }
]);

📊 Real-Time Usage

Streaming Responses

const stream = await ai.chat([
  { role: 'user', content: 'Write a detailed analysis' }
], { stream: true });

for await (const chunk of stream) {
  console.log(chunk); // Real-time output
}

Progress Tracking

import { useJobStatus } from '@digilogiclabs/saas-factory-ai';

function VideoGenerator() {
  const [jobId, setJobId] = useState(null);
  const { status, progress, isComplete } = useJobStatus(jobId);

  return (
    <div>
      {status === 'running' && <Progress value={progress} />}
      {isComplete && <VideoPlayer url={status.result.url} />}
    </div>
  );
}

🛡️ Security & Privacy

  • 🔐 No API Keys in Client: All AI providers accessed through secure gateway
  • 🔑 JWT Authentication: Secure token-based authentication
  • 📊 Usage Tracking: Monitor and control AI usage and costs
  • 🚨 Rate Limiting: Prevent abuse and unexpected charges
  • 🔍 Audit Logging: Complete audit trail of AI operations
  • 🛡️ Content Filtering: Built-in safety and content moderation

💰 Cost Management

// Real-time cost estimation
const estimate = await ai.estimateCost([
  { capability: 'text.chat', input: 'Long article generation' },
  { capability: 'video.generation', input: '8-second demo video' }
]);

console.log(`Estimated cost: $${estimate.totalEstimated}`);

// Budget controls
if (estimate.totalEstimated > 5.00) {
  console.log('Operation exceeds budget');
  return;
}

// Proceed with operations
const results = await ai.batch(operations);

🌍 Community & Examples

Real-World Applications

Templates

📝 License

MIT License - see the LICENSE file for details.

🤝 Support & Community


Part of the SaaS Factory Ecosystem: