Skip to content

50+ open-source generative AI apps you can clone, deploy, and monetize — image generators, video tools, virtual try-ons, AI SaaS templates, and platform integrations. One-click Vercel deploy on every template.

Restore: src/app/providers.js

Anil Chandra Naidu Matcha1877a568fa22
diff --git a/src/app/providers.js b/src/app/providers.js
new file mode 100644
index 0000000..659111e
--- /dev/null
+++ b/src/app/providers.js
@@ -0,0 +1,20 @@
+"use client";
+
+import { SessionProvider } from "next-auth/react";
+import { useEffect } from "react";
+import config from "@/lib/config";
+
+export function Providers({ children }) {
+ useEffect(() => {
+ if (typeof window !== "undefined") {
+ const theme = config?.theme || "slate-indigo";
+ document.documentElement.setAttribute("data-theme", theme);
+ }
+ }, []);
+
+ return (
+ <SessionProvider>
+ {children}
+ </SessionProvider>
+ );
+}