Open the IDX terminal and run the genkit command. This will show a prompt for the terms and conditions for Genkit. Hit enter to accept.
Use the IDX Integration Panel to the left to get an API Key and replace it in the .idx/dev.nix file.
# Sets environment variables in the workspace
env = {
# You can get a Gemini API key through the IDX Integrations panel to the left!
GOOGLE_API_KEY = "<your-api-key>";
};Near the bottom of .idx/dev.nix add the preview panel configuration below and rebuild the environment.
idx.previews = {
enable = true;
previews = [
{
command = [
"npx"
"genkit"
"start"
"--port"
"$PORT"
];
manager = "web";
id = "web";
}
];
};