P
Prisma•2mo ago
lucien-george

Can't set api key/token when using Optimize

The documentation says to add the apikey as follows
import { PrismaClient } from "@prisma/client";
import { withOptimize } from "@prisma/extension-optimize";

const prisma = new PrismaClient().$extends(withOptimize({ apiKey: process.env.OPTIMIZE_API_KEY }))
import { PrismaClient } from "@prisma/client";
import { withOptimize } from "@prisma/extension-optimize";

const prisma = new PrismaClient().$extends(withOptimize({ apiKey: process.env.OPTIMIZE_API_KEY }))
But when trying to actually extend the prisma client, I can't seem to set the apiKey (see screenshot). I am using version 1.0.0 and prisma 5.19.1
No description
2 Replies
RaphaelEtim
RaphaelEtim•2mo ago
Hi @lucien-george 👋 Did you regenerate the client by running npx prisma generate? Also can you try reloading your IDE
lucien-george
lucien-george•5w ago
I did both, but still get the same thing
Want results from more Discord servers?
Add your server