This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // npm i openai dotenv | |
| import { config } from 'dotenv'; | |
| config(); | |
| // OpenAI API Configuration | |
| import { Configuration, OpenAIApi } from "openai"; | |
| const configuration = new Configuration({ | |
| apiKey: process.env.OPENAI_API_KEY, // Replace this with your key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Next.js API route support: https://nextjs.org/docs/api-routes/introduction | |
| import NextAuth from 'next-auth/next'; | |
| import GoogleProvider from 'next-auth/providers/google' | |
| export const authOptions = { | |
| providers: [ | |
| GoogleProvider({ | |
| clientId: process.env.GOOGLE_CLIENT_ID as string, | |
| clientSecret: process.env.GOOGLE_CLIENT_SECRET as string, | |
| }), |