Skip to content

Add Firebase AI SDK sample app #889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ai/ai-react-app/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
33 changes: 33 additions & 0 deletions ai/ai-react-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Firebase AI Sample App

![Photo of the Firebase AI Sample App](images/screenshot.png)

This sample application demonstrates features of the Firebase AI SDK for Web (`firebase/ai`), integrated into a web application built with React and TypeScript.

For more information about the Firebase AI SDK, see the [Firebase AI Logic Docs](https://firebase.google.com/docs/vertex-ai).

## Setup Instructions

1. Follow the instructions to create a Firebase project that uses Firebase AI Logic.

1. Update `src/config/firebase-config.ts` with your Firebase project configuration.

1. Install dependencies:

```bash
yarn
```

1. Start the development server:

```bash
yarn dev
```

## Support

- [Firebase Support](https://firebase.google.com/support/)

## License

© Google, 2025. Licensed under an [Apache-2](../LICENSE)
30 changes: 30 additions & 0 deletions ai/ai-react-app/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier/flat"

export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
eslintConfigPrettier
);
6 changes: 6 additions & 0 deletions ai/ai-react-app/firebase-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ai/ai-react-app/images/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions ai/ai-react-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/firebase-icon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Firebase AI Sample App</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading