diff --git a/clients/search-component/README.md b/clients/search-component/README.md index 77d2c3b8a5..61393714f2 100644 --- a/clients/search-component/README.md +++ b/clients/search-component/README.md @@ -77,6 +77,7 @@ declare module "solid-js" { | -------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------ | | datasetId | string | '' | | apiKey | string | '' | +| baseUrl | string | "https://api.trieve.ai" | | chat | boolean | true | | analytics | boolean | true | | placeholder | string | "Search..." | @@ -90,8 +91,8 @@ declare module "solid-js" { | defaultAiQuestions | string[] | [] | | brandLogoImgSrcUrl | string | null | | brandName | string | null | +| brand Color | string | #CB53EB | | problemLink | string | null | -| accentColor | string | #CB53EB | | responsive | boolean | false | ### Search Results diff --git a/clients/search-component/example/.env.dist b/clients/search-component/example/.env.dist new file mode 100644 index 0000000000..5ed2c3b970 --- /dev/null +++ b/clients/search-component/example/.env.dist @@ -0,0 +1,7 @@ +VITE_API_BASE_URL="https://api.trieve.ai" +VITE_DATASET_ID="4538ad9f-47cf-44d4-8a14-7c111f9558a9" +VITE_API_KEY="tr-zpPVGUq18FxOCmXgLfqGbmDOY4UMW00r" +VITE_BRAND_LOGO_SRC_URL="https://cdn.trieve.ai/trieve-logo.png" +VITE_BRAND_NAME="Trieve" +VITE_BRAND_COLOR="#CB53EB" +VITE_PROBLEM_LINK="mailto:help@trieve.ai?subject=" \ No newline at end of file diff --git a/clients/search-component/example/src/routes/index.lazy.tsx b/clients/search-component/example/src/routes/index.lazy.tsx index 60e4bbcc78..d4dc1b8ff3 100644 --- a/clients/search-component/example/src/routes/index.lazy.tsx +++ b/clients/search-component/example/src/routes/index.lazy.tsx @@ -11,6 +11,14 @@ export const Route = createLazyFileRoute("/")({ }); export default function Home() { + const baseUrl = import.meta.env.VITE_API_BASE_URL; + const datasetId = import.meta.env.VITE_DATASET_ID; + const apiKey = import.meta.env.VITE_API_KEY; + const brandName = import.meta.env.VITE_BRAND_NAME; + const brandLogoSrcUrl = import.meta.env.VITE_BRAND_LOGO_SRC_URL; + const brandColor = import.meta.env.VITE_ACCENT_COLOR; + const problemLink = import.meta.env.VITE_PROBLEM_LINK; + const [theme, setTheme] = useState<"light" | "dark">("light"); const [component, setComponent] = useState(0); return ( @@ -40,9 +48,10 @@ export default function Home() {