Skip to content

Commit 3404f1c

Browse files
authored
Merge pull request #33 from sendbird/feat/AA-1920
[AA-1920] feat: Add js sample page
2 parents 57c8cfd + 622e4ea commit 3404f1c

23 files changed

+2044
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/node_modules
2+
**/dist
3+
**/.vite
4+
**/deps

catalog-info.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: backstage.io/v1alpha1
2+
kind: Resource
3+
metadata:
4+
name: sendbird-ai-agent
5+
description: AI Agent Messenger Guide for Android, iOS, and Web
6+
annotations:
7+
github.com/project-slug: sendbird/sendbird-ai-agent
8+
spec:
9+
type: library-internal dev
10+
lifecycle: production
11+
owner: dep-client-platform
12+
system: sendbird-ai-agent

sample/.env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
VITE_APP_ID=10306808-B7F3-436F-9F5C-29F431B47B73
2+
VITE_AI_AGENT_ID=e4c57465-4773-432e-9740-f0284a951494
3+
4+
VITE_NEW_APP_ID=10306808-B7F3-436F-9F5C-29F431B47B73
5+
VITE_NEW_AI_AGENT_ID=1bad24e5-70c7-4ca4-b582-37d1b8f1a664
6+
VITE_NEW_USER_ID=aiagent-test-user
7+
VITE_NEW_USER_AUTH_TOKEN=2566161820e294ddc2085cce846f429a94e6fa2f
8+

sample/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# AI Agent Messenger Sample
2+
3+
An interactive web guide demonstrating how to integrate the AI Agent Messenger into a web application. This web application serves as both a demonstration and a step-by-step guide for implementation without any additional dependencies.
4+
5+
## Prerequisites
6+
7+
- Node.js >= 20.0.0
8+
- pnpm >= 8.0.0
9+
10+
## Installation
11+
12+
```bash
13+
// under js/samples/basic dir
14+
pnpm install
15+
```
16+
17+
## Development
18+
19+
To start the development server:
20+
21+
```bash
22+
pnpm dev
23+
```
24+
25+
The application will be available at `http://localhost:5173`

sample/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en" class="h-full bg-gray-50">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
6+
<link rel="stylesheet" href="style.css">
7+
<title>Sendbird AI Agent Messenger Sample</title>
8+
</head>
9+
<body class="h-full">
10+
<script type="module" src="./src/main.tsx"></script>
11+
<div id="root"></div>
12+
</body>
13+
</html>

sample/package.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"private": true,
3+
"name": "ai-agent-messenger-samples",
4+
"version": "0.0.1",
5+
"description": "AI Agent Messenger Sample - Basic",
6+
"type": "module",
7+
"scripts": {
8+
"preinstall": "npx only-allow pnpm",
9+
"prepare": "corepack enable",
10+
"install": "pnpm prepare && pnpm preinstall",
11+
"dev": "vite",
12+
"build": "vite build",
13+
"format": "prettier --check \"**/*.{ts,tsx}\"",
14+
"format:fix": "prettier --write \"**/*.{ts,tsx}\""
15+
},
16+
"packageManager": "pnpm@8.15.4",
17+
"engines": {
18+
"node": ">=20.0.0",
19+
"pnpm": ">=8.0.0"
20+
},
21+
"dependencies": {
22+
"@codemirror/lang-html": "^6.4.7",
23+
"@codemirror/lang-javascript": "^6.2.1",
24+
"@tailwindcss/vite": "^4.0.15",
25+
"@uiw/codemirror-theme-dracula": "^4.23.10",
26+
"@uiw/react-codemirror": "^4.21.21",
27+
"react": "^19.0.0",
28+
"react-dom": "^19.0.0",
29+
"tailwindcss": "^4.0.15",
30+
"vite": "^5.1.4"
31+
},
32+
"devDependencies": {
33+
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
34+
"@types/node": "^22.13.13",
35+
"@types/react": "^19.0.0",
36+
"@types/react-dom": "^19.0.0",
37+
"@vitejs/plugin-react": "^4.2.1",
38+
"prettier": "^3.2.5",
39+
"typescript": "^5.0.0",
40+
"vite-tsconfig-paths": "^5.1.4"
41+
},
42+
"prettier": {
43+
"printWidth": 120,
44+
"tabWidth": 2,
45+
"useTabs": false,
46+
"semi": true,
47+
"singleQuote": true,
48+
"quoteProps": "preserve",
49+
"trailingComma": "all",
50+
"bracketSpacing": true,
51+
"arrowParens": "always",
52+
"plugins": [
53+
"@trivago/prettier-plugin-sort-imports"
54+
],
55+
"importOrder": [
56+
"<THIRD_PARTY_MODULES>",
57+
"@sendbird[./]?",
58+
"@(components|constants|types|utils)[./]?",
59+
"^[./]"
60+
],
61+
"importOrderSeparation": true,
62+
"importOrderSortSpecifiers": true,
63+
"importOrderCaseInsensitive": false
64+
}
65+
}

0 commit comments

Comments
 (0)