Loading...
Loading...
Build with Tambo in an existing React app. Use for existing codebases (providers, env vars, components, threads, tools). For brand-new apps, use generative-ui.
npx skill4agent add tambo-ai/tambo build-with-tambotambo inittambo addcreate-app# Key files to read
package.json # Dependencies and scripts
tsconfig.json # TypeScript config
next.config.* # Next.js
vite.config.* # Vite
tailwind.config.* # Tailwind CSS
postcss.config.* # PostCSS
src/index.* or app/ # Entry points| Technology | Detection |
|---|---|
| Next.js | |
| Vite | |
| Create React App | |
| TypeScript | |
| Tailwind | |
| Plain CSS | No Tailwind, CSS files in src/ |
| Zod | |
| Other validation | |
I detected your project uses:
- Framework: Next.js 14 (App Router)
- Styling: Tailwind CSS
- Validation: No Zod (will need to add)
- TypeScript: Yes
Should I:
1. Install Tambo with these settings?
2. Use plain CSS instead of Tailwind for Tambo components?
3. Something else?# Core (always required)
npm install @tambo-ai/react
# If no Zod installed
npm install zod// app/providers.tsx
"use client";
import { TamboProvider } from "@tambo-ai/react";
import { components } from "@/lib/tambo";
export function Providers({ children }: { children: React.ReactNode }) {
return (
<TamboProvider
apiKey={process.env.NEXT_PUBLIC_TAMBO_API_KEY}
components={components}
>
{children}
</TamboProvider>
);
}// app/layout.tsx
import { Providers } from "./providers";
export default function RootLayout({ children }) {
return (
<html>
<body>
<Providers>{children}</Providers>
</body>
</html>
);
}// pages/_app.tsx
import { TamboProvider } from "@tambo-ai/react";
import { components } from "@/lib/tambo";
export default function App({ Component, pageProps }) {
return (
<TamboProvider
apiKey={process.env.NEXT_PUBLIC_TAMBO_API_KEY}
components={components}
>
<Component {...pageProps} />
</TamboProvider>
);
}// src/main.tsx
import { TamboProvider } from "@tambo-ai/react";
import { components } from "./lib/tambo";
import App from "./App";
ReactDOM.createRoot(document.getElementById("root")!).render(
<TamboProvider
apiKey={import.meta.env.VITE_TAMBO_API_KEY}
components={components}
>
<App />
</TamboProvider>,
);// lib/tambo.ts (or src/lib/tambo.ts)
import { TamboComponent } from "@tambo-ai/react";
export const components: TamboComponent[] = [
// Components will be registered here
];// Skip --yes flag to customize styling during add
npx tambo add message-thread-full
# Select "CSS Modules" or "Plain CSS" when promptedcd packages/web
npx tambo init --api-key=sk_...npx tambo init --api-key=sk_....env.local| Framework | Variable |
|---|---|
| Next.js | |
| Vite | |
| CRA | |
import { useTambo } from "@tambo-ai/react";
function TestComponent() {
const { thread, isIdle } = useTambo();
console.log("Tambo connected:", isIdle);
return <div>Tambo is set up!</div>;
}@tambo-ai/react@tambo-ai/clienttambotambo-ai/tambo**Title:** [Short description of the problem]
**Expected behavior**
What should happen.
**Actual behavior**
What happens instead, including any error messages or stack traces.
**Repro steps**
1. Run `npx tambo create-app ...` (or whatever command)
2. Add this code:
```tsx
// minimal code that reproduces the issue
```
3. Observe the error
**Environment**
- `@tambo-ai/react` version:
- `@tambo-ai/client` version:
- Framework (Next.js / Vite / CRA) and version:
- Node.js version:
- OS:
**Additional context**
Link to relevant docs or skill file path if applicable.This looks like a bug in. Want me to open a GitHub issue on@tambo-ai/reactwith the repro steps and environment details?tambo-ai/tambo