-
-
-
+ {enableUpdateAvatar && (
+
+
+
+ )}
diff --git a/src/app/[locale]/providers.tsx b/src/app/[locale]/providers.tsx
index 40f290e..5e85838 100644
--- a/src/app/[locale]/providers.tsx
+++ b/src/app/[locale]/providers.tsx
@@ -1,10 +1,10 @@
'use client';
import { ActiveThemeProvider } from '@/components/layout/active-theme-provider';
+import { CreditsProvider } from '@/components/layout/credits-provider';
import { PaymentProvider } from '@/components/layout/payment-provider';
import { TooltipProvider } from '@/components/ui/tooltip';
import { websiteConfig } from '@/config/website';
-import { CreditsProvider } from '@/providers/credits-provider';
import type { Translations } from 'fumadocs-ui/i18n';
import { RootProvider } from 'fumadocs-ui/provider';
import { useTranslations } from 'next-intl';
diff --git a/src/app/api/analyze-content/route.ts b/src/app/api/analyze-content/route.ts
index 26bfddf..91db24e 100644
--- a/src/app/api/analyze-content/route.ts
+++ b/src/app/api/analyze-content/route.ts
@@ -23,6 +23,7 @@ import { createDeepSeek } from '@ai-sdk/deepseek';
import { createGoogleGenerativeAI } from '@ai-sdk/google';
import { createOpenAI } from '@ai-sdk/openai';
import FirecrawlApp from '@mendable/firecrawl-js';
+import { createOpenRouter } from '@openrouter/ai-sdk-provider';
import { generateObject } from 'ai';
import { type NextRequest, NextResponse } from 'next/server';
import { z } from 'zod';
@@ -218,7 +219,7 @@ async function analyzeContent(
break;
case 'gemini':
model = createGoogleGenerativeAI({
- apiKey: process.env.GOOGLE_API_KEY,
+ apiKey: process.env.GOOGLE_GENERATIVE_AI_API_KEY,
}).chat(webContentAnalyzerConfig.gemini.model);
temperature = webContentAnalyzerConfig.gemini.temperature;
maxTokens = webContentAnalyzerConfig.gemini.maxTokens;
@@ -230,6 +231,13 @@ async function analyzeContent(
temperature = webContentAnalyzerConfig.deepseek.temperature;
maxTokens = webContentAnalyzerConfig.deepseek.maxTokens;
break;
+ case 'openrouter':
+ model = createOpenRouter({
+ apiKey: process.env.OPENROUTER_API_KEY,
+ }).chat(webContentAnalyzerConfig.openrouter.model);
+ temperature = webContentAnalyzerConfig.openrouter.temperature;
+ maxTokens = webContentAnalyzerConfig.openrouter.maxTokens;
+ break;
default:
throw new WebContentAnalyzerError(
ErrorType.VALIDATION,
@@ -254,7 +262,7 @@ async function analyzeContent(
- Ensure the title and description are meaningful and based on the actual content
`,
temperature,
- maxTokens,
+ maxOutputTokens: maxTokens,
});
return {
@@ -336,7 +344,7 @@ export async function POST(req: NextRequest) {
if (!urlValidation.success) {
const urlError = new WebContentAnalyzerError(
ErrorType.VALIDATION,
- urlValidation.error.errors[0]?.message || 'Invalid URL',
+ urlValidation.error.issues[0]?.message || 'Invalid URL',
'Please enter a valid URL starting with http:// or https://',
ErrorSeverity.MEDIUM,
false
diff --git a/src/components/auth/forgot-password-form.tsx b/src/components/auth/forgot-password-form.tsx
index ed4c93f..66f6758 100644
--- a/src/components/auth/forgot-password-form.tsx
+++ b/src/components/auth/forgot-password-form.tsx
@@ -32,7 +32,7 @@ export const ForgotPasswordForm = ({ className }: { className?: string }) => {
const searchParams = useSearchParams();
const ForgotPasswordSchema = z.object({
- email: z.string().email({
+ email: z.email({
message: t('emailRequired'),
}),
});
diff --git a/src/components/auth/login-form.tsx b/src/components/auth/login-form.tsx
index 4f29a7c..60145a0 100644
--- a/src/components/auth/login-form.tsx
+++ b/src/components/auth/login-form.tsx
@@ -69,7 +69,7 @@ export const LoginForm = ({
: z.string().optional();
const LoginSchema = z.object({
- email: z.string().email({
+ email: z.email({
message: t('emailRequired'),
}),
password: z.string().min(1, {
diff --git a/src/components/auth/register-form.tsx b/src/components/auth/register-form.tsx
index 9ed63b7..ea0dbba 100644
--- a/src/components/auth/register-form.tsx
+++ b/src/components/auth/register-form.tsx
@@ -64,7 +64,7 @@ export const RegisterForm = ({
: z.string().optional();
const RegisterSchema = z.object({
- email: z.string().email({
+ email: z.email({
message: t('emailRequired'),
}),
password: z.string().min(1, {
diff --git a/src/components/contact/contact-form-card.tsx b/src/components/contact/contact-form-card.tsx
index b084d62..2914884 100644
--- a/src/components/contact/contact-form-card.tsx
+++ b/src/components/contact/contact-form-card.tsx
@@ -40,7 +40,7 @@ export function ContactFormCard() {
// Create a schema for contact form validation
const formSchema = z.object({
name: z.string().min(3, t('nameMinLength')).max(30, t('nameMaxLength')),
- email: z.string().email(t('emailValidation')),
+ email: z.email(t('emailValidation')),
message: z
.string()
.min(10, t('messageMinLength'))
diff --git a/src/providers/credits-provider.tsx b/src/components/layout/credits-provider.tsx
similarity index 100%
rename from src/providers/credits-provider.tsx
rename to src/components/layout/credits-provider.tsx
diff --git a/src/components/newsletter/newsletter-form.tsx b/src/components/newsletter/newsletter-form.tsx
index 489cf8c..0dbc6fe 100644
--- a/src/components/newsletter/newsletter-form.tsx
+++ b/src/components/newsletter/newsletter-form.tsx
@@ -29,7 +29,7 @@ export function NewsletterForm() {
// newsletter schema
const NewsletterFormSchema = z.object({
- email: z.string().email({
+ email: z.email({
message: t('emailValidation'),
}),
});
diff --git a/src/components/waitlist/waitlist-form-card.tsx b/src/components/waitlist/waitlist-form-card.tsx
index 36fd911..ea0d1b9 100644
--- a/src/components/waitlist/waitlist-form-card.tsx
+++ b/src/components/waitlist/waitlist-form-card.tsx
@@ -38,7 +38,7 @@ export function WaitlistFormCard() {
// Create a schema for waitlist form validation
const formSchema = z.object({
- email: z.string().email({ message: t('emailValidation') }),
+ email: z.email({ message: t('emailValidation') }),
});
// Initialize the form
diff --git a/src/config/website.tsx b/src/config/website.tsx
index 1b16d83..c37715b 100644
--- a/src/config/website.tsx
+++ b/src/config/website.tsx
@@ -36,6 +36,7 @@ export const websiteConfig: WebsiteConfig = {
enableDiscordWidget: false,
enableCrispChat: process.env.NEXT_PUBLIC_DEMO_WEBSITE === 'true',
enableUpgradeCard: true,
+ enableUpdateAvatar: true,
enableAffonsoAffiliate: false,
enablePromotekitAffiliate: false,
enableDatafastRevenueTrack: false,
diff --git a/src/types/index.d.ts b/src/types/index.d.ts
index 7e1c6eb..8fe2967 100644
--- a/src/types/index.d.ts
+++ b/src/types/index.d.ts
@@ -71,6 +71,7 @@ export interface FeaturesConfig {
enableDiscordWidget?: boolean; // Whether to enable the discord widget, deprecated
enableCrispChat?: boolean; // Whether to enable the crisp chat
enableUpgradeCard?: boolean; // Whether to enable the upgrade card in the sidebar
+ enableUpdateAvatar?: boolean; // Whether to enable the update avatar in settings
enableAffonsoAffiliate?: boolean; // Whether to enable affonso affiliate
enablePromotekitAffiliate?: boolean; // Whether to enable promotekit affiliate
enableDatafastRevenueTrack?: boolean; // Whether to enable datafast revenue tracking