In a Next.js API route (server-side code), calling client.createToken(userId) on a client from StreamChat.getInstance(process.env.STREAM_KEY, process.env.STREAM_SECRET) throws Error: tokens can only be created server-side using the API Secret, even though the secret is passed. The key and secret env vars are correctly set, and the reporter confirmed they are read properly. The client instance reports the secret as undefined despite the secret being passed to getInstance.