Skip to content

add official Next.js and Vite sample projects (closes #430)fix next-js template#622

Open
Demiladepy wants to merge 2 commits intoIQAIcom:mainfrom
Demiladepy:fix-issues
Open

add official Next.js and Vite sample projects (closes #430)fix next-js template#622
Demiladepy wants to merge 2 commits intoIQAIcom:mainfrom
Demiladepy:fix-issues

Conversation

@Demiladepy
Copy link
Copy Markdown

Description

Adds official starter sample projects for Next.js and Vite integrations with ADK-TS. Both projects demonstrate basic agent setup, streaming responses, and tool usage with their own README and setup instructions.

Related Issue

Closes #430

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring (no functional changes)
  • Tests
  • Other (please describe):

How Has This Been Tested?

  • Ran cd apps/examples/nextjs-starter && pnpm install && pnpm dev — Next.js app builds and agent responds correctly
  • Ran cd apps/examples/vite-starter && pnpm install && pnpm dev — Vite app builds and agent responds correctly
  • Verified streaming responses work in both environments
  • Tested tool usage example in both projects

Checklist

  • My code follows the code style of this project
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • My changes generate no new warnings
  • I have checked for potential breaking changes and addressed them

Additional Notes

Both sample projects use @iqai/adk and follow the same structure as existing examples in apps/examples/. Each project includes a standalone README with setup steps, required environment variables, and usage instructions.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 19, 2026

Someone is attempting to deploy a commit to the IQ Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 19, 2026

⚠️ No Changeset found

Latest commit: 8668ced

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces two new official sample projects, one for Next.js and one for Vite, to showcase the integration of ADK-TS. These examples provide clear demonstrations of core functionalities such as agent setup, streaming responses, and tool utilization within modern web frameworks. Additionally, it includes a refinement to the existing Next.js template to improve its build process and simplify agent interaction.

Highlights

  • New Sample Projects: Added official starter sample projects for Next.js and Vite, demonstrating ADK-TS integrations including basic agent setup, streaming responses, and tool usage.
  • Next.js Template Fix: Resolved an issue in the Next.js template by removing the --turbopack flag from the build script and refactoring the agent runner initialization for simplicity.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request provides fixes for the Next.js starter template. The changes include removing the experimental --turbopack flag from the build script for improved stability, and refactoring the server action for interacting with the agent. The refactoring correctly removes a problematic in-memory caching mechanism, resolving a potential state-sharing bug in a serverless environment. My review includes a suggestion to consider the performance implications of this change for production environments.


export async function askAgent(message: string) {
const runner = await getAgentRunner();
const { runner } = await getRootAgent();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Calling getRootAgent() on every request might introduce performance overhead if agent initialization is a costly process. While this change correctly fixes a state-sharing bug from the previous implementation by ensuring request isolation, this approach could become a bottleneck in a production application.

A potential optimization would be to cache the agent definition and only create a new runner or session for each request. This would depend on the specific API provided by the @iqai/adk library for creating sessions from a pre-built agent.

@Timonwa
Copy link
Copy Markdown
Contributor

Timonwa commented Mar 23, 2026

Hey @Demiladepy — thanks for contributing, great to have our first community PR! 🎉

A few things I need clarification on:

  1. The PR description says "adds official Next.js and Vite starter projects" but the actual changes are just 3 small edits to the existing next-js-starter. Did you forget to push some commits, or is the description from a different PR?

  2. On the actual changes — can you explain the reasoning behind them?

    • Removing --turbopack from the build command — Turbopack is the recommended bundler for Next.js builds now, why remove it?
    • Removing the agentRunner singleton in _actions.ts — this was caching the runner to avoid re-initializing on every call. Without it, getRootAgent() runs on every request, which seems like a regression?
    • Deleting card.tsx — was this component actually unused, or is something else importing it?

Just want to make sure I'm not missing context here.

@Timonwa Timonwa self-requested a review March 23, 2026 14:49
@Demiladepy
Copy link
Copy Markdown
Author

Demiladepy commented Mar 23, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create official Next.js and Vite sample projects for ADK-TS

2 participants