You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
baseUrl: "https://example.com", // if not using a vite `base`, this is required because the chatgpt iframe is sandboxed and absolute URL links are required
28
28
}),
29
29
],
@@ -44,12 +44,12 @@ export default defineConfig({
44
44
Create React components in your widgets directory:
45
45
46
46
```tsx
47
-
// in web/chatgpt-widgets/Hello.tsx
47
+
// in web/chatgpt/Hello.tsx
48
48
exportdefaultfunction Hello() {
49
49
return <div>Hello from ChatGPT Widget!</div>;
50
50
}
51
51
52
-
// in web/chatgpt-widgets/ListFoobars.tsx
52
+
// in web/chatgpt/ListFoobars.tsx
53
53
exportdefaultfunction ListFoobars() {
54
54
return (
55
55
<ul>
@@ -66,7 +66,7 @@ export default function ListFoobars() {
66
66
You can optionally create a root layout component that will wrap all widgets. If a file named `root.tsx` (or `root.ts`, `root.jsx`, `root.js`) exists in the widgets directory, it will automatically wrap all other widget components:
67
67
68
68
```tsx
69
-
// web/chatgpt-widgets/root.tsx
69
+
// web/chatgpt/root.tsx
70
70
exportdefaultfunction RootLayout({ children }: { children:React.ReactNode }) {
71
71
return (
72
72
<SomeProvider>
@@ -91,10 +91,10 @@ After setting up the plugin and writing some widgets, you need to expose the wid
-`baseUrl` (string, optional): Base URL for widget assets. Required if Vite's `base` config is not an absolute URL and you need fully qualified URLs for sandboxed iframes. Should include protocol and domain (e.g., `"https://example.com"`). Note: Does not require trailing slash.
0 commit comments