Skip to content

Latest commit

聽

History

History
101 lines (76 loc) 路 2.37 KB

File metadata and controls

101 lines (76 loc) 路 2.37 KB

TanStack Preact AI Devtools

Developer tools for TanStack AI in Preact applications.

Installation

npm install @tanstack/preact-ai-devtools
# or
pnpm add @tanstack/preact-ai-devtools
# or
yarn add @tanstack/preact-ai-devtools

Usage

Using the Panel Component

Add the AiDevtoolsPanel component to your app:

import { AiDevtoolsPanel } from '@tanstack/preact-ai-devtools'

function App() {
  return (
    <>
      <YourApp />
      <AiDevtoolsPanel />
    </>
  )
}

Using the Plugin

You can also use the devtools as a plugin:

import { aiDevtoolsPlugin } from '@tanstack/preact-ai-devtools'
import { useAIProvider } from '@tanstack/ai-preact'

function App() {
  const ai = useAIProvider({
    // your config
    plugins: [aiDevtoolsPlugin()],
  })

  return <YourApp />
}

Production Builds

For production builds, import from the production entry point to exclude devtools code:

import { AiDevtoolsPanel } from '@tanstack/preact-ai-devtools/production'

The devtools will automatically be disabled in production environments when using the main entry point.

Get Involved