diff --git a/apps/docs/lib/constants.ts b/apps/docs/lib/constants.ts
index d1bbedbf47c..42c12c0d3f4 100644
--- a/apps/docs/lib/constants.ts
+++ b/apps/docs/lib/constants.ts
@@ -1,2 +1,3 @@
export const IS_PLATFORM = process.env.NEXT_PUBLIC_IS_PLATFORM === 'true'
export const LOCAL_SUPABASE = process.env.NEXT_PUBLIC_LOCAL_SUPABASE === 'true'
+export const API_URL = process.env.NEXT_PUBLIC_API_URL
diff --git a/apps/docs/lib/fetchWrappers.tsx b/apps/docs/lib/fetchWrappers.tsx
index c573a0d37dc..0313e49565f 100644
--- a/apps/docs/lib/fetchWrappers.tsx
+++ b/apps/docs/lib/fetchWrappers.tsx
@@ -1,7 +1,5 @@
interface DataProps {
- referrer?: string
- title: string
- route?: string
+ [prop: string]: any
}
export const post = (url: string, data: DataProps, options = {}) => {
diff --git a/apps/docs/pages/_app.tsx b/apps/docs/pages/_app.tsx
index 8563418f9a8..7c3519884b8 100644
--- a/apps/docs/pages/_app.tsx
+++ b/apps/docs/pages/_app.tsx
@@ -1,6 +1,6 @@
import { createBrowserSupabaseClient } from '@supabase/auth-helpers-nextjs'
import { SessionContextProvider } from '@supabase/auth-helpers-react'
-import { AuthProvider, ThemeProvider } from 'common'
+import { AuthProvider, ThemeProvider, useTelemetryProps } from 'common'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
import ReactMarkdown from 'react-markdown'
@@ -10,7 +10,7 @@ import { CommandMenuProvider } from 'ui'
import components from '~/components'
import Favicons from '~/components/Favicons'
import SiteLayout from '~/layouts/SiteLayout'
-import { IS_PLATFORM, LOCAL_SUPABASE } from '~/lib/constants'
+import { API_URL, IS_PLATFORM, LOCAL_SUPABASE } from '~/lib/constants'
import { post } from '~/lib/fetchWrappers'
import '../styles/ch.scss'
import '../styles/main.scss?v=1.0.0'
@@ -19,16 +19,21 @@ import '../styles/prism-okaidia.scss'
function MyApp({ Component, pageProps }: AppPropsWithLayout) {
const router = useRouter()
+ const telemetryProps = useTelemetryProps()
const [supabase] = useState(() =>
IS_PLATFORM || LOCAL_SUPABASE ? createBrowserSupabaseClient() : undefined
)
function handlePageTelemetry(route: string) {
- return post(`https://api.supabase.io/platform/telemetry/page`, {
+ return post(`${API_URL}/telemetry/page`, {
referrer: document.referrer,
title: document.title,
route,
+ ga: {
+ screen_resolution: telemetryProps?.screenResolution,
+ language: telemetryProps?.language,
+ },
})
}
diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-expo.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-expo.mdx
index aa420134d55..d4b0805ec49 100644
--- a/apps/docs/pages/guides/getting-started/tutorials/with-expo.mdx
+++ b/apps/docs/pages/guides/getting-started/tutorials/with-expo.mdx
@@ -45,21 +45,21 @@ These variables will be exposed on the browser, and that's completely fine since
[Row Level Security](/docs/guides/auth#row-level-security) enabled on our Database.
```ts title=lib/supabase.ts
-import * as SecureStore from "expo-secure-store";
+import 'react-native-url-polyfill/auto'
+import * as SecureStore from 'expo-secure-store'
import { createClient } from '@supabase/supabase-js'
-
const ExpoSecureStoreAdapter = {
getItem: (key: string) => {
- return SecureStore.getItemAsync(key);
+ return SecureStore.getItemAsync(key)
},
setItem: (key: string, value: string) => {
- SecureStore.setItemAsync(key, value);
+ SecureStore.setItemAsync(key, value)
},
removeItem: (key: string) => {
- SecureStore.deleteItemAsync(key);
+ SecureStore.deleteItemAsync(key)
},
-};
+}
const supabaseUrl = YOUR_REACT_NATIVE_SUPABASE_URL
const supabaseAnonKey = YOUR_REACT_NATIVE_SUPABASE_ANON_KEY
diff --git a/apps/www/_customers/mendableai.mdx b/apps/www/_customers/mendableai.mdx
index 54f35d8b054..70fa0b0075b 100644
--- a/apps/www/_customers/mendableai.mdx
+++ b/apps/www/_customers/mendableai.mdx
@@ -1,8 +1,8 @@
---
title: Mendable.ai switches from Pinecone to Supabase for PostgreSQL vector embeddings.
name: Mendable.ai
-description: How Mendable.ai boosts efficiency and accuracy of chat powered search for documentation using Supabase with pg_vector.
-author: rory_wilding
+description: How Mendable.ai boosts efficiency and accuracy of chat powered search for documentation using Supabase with pg_vector.
+author: paul_copplestone
author_title: Supabase
author_url: https://github.com/kiwicopple
author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4
@@ -24,31 +24,35 @@ misc: [{ label: 'Backed by', text: 'Y Combinator' }]
about: Mendable.ai is Chat Powered Search for Documentation.
---
-[Mendable.ai](http://mendable.ai/) provides a chat-powered search engine for technical documentation. Their AI-powered search tool makes it easier for developers and other technical users to find relevant information in complex documentation. Users can simply ask questions in natural language, and the tool returns the most relevant answers. [Mendable.ai](http://mendable.ai/)'s search engine also provides detailed analytics, which helps teams identify knowledge gaps and areas for improvement in their documentation.
+[Mendable.ai](http://mendable.ai/) provides a chat-powered search engine for technical documentation. Their AI-powered search tool makes it easier for developers and other technical users to find relevant information in complex documentation. Users can simply ask questions in natural language, and the tool returns the most relevant answers. Mendable.ai's search engine also provides detailed analytics, which helps teams identify knowledge gaps and areas for improvement in their documentation.
## The Challenge
-[Mendable.ai](http://mendable.ai/) needed to store and search through large amounts of vector data to improve the efficiency and accuracy of their similarity search operations for their Chat Powered Search for Documentation. They tried Faiss, Weviate, and Pinecone., but found them to be expensive and not very intuitive, especially when it came to storing metadata along with the vectors.
+Mendable.ai was experiencing tremendous success, with WAUs growing nearly 300% since March, and started looking for a tool to store and search through large amounts of vector data to improve the efficiency and accuracy of their similarity search operations for their Chat Powered Search for Documentation. They tried Faiss, Weviate, and Pinecone, but found them to be expensive and not very intuitive, especially when it came to storing metadata along with the vectors.
Why they chose Supabase:
-[Mendable.ai](http://mendable.ai/) discovered that Supabase supports pg_vector and found it to be a simple and cost-effective solution. They were impressed with the open-source nature of Supabase, as well as its ability to store metadata alongside the vectors. They also appreciated the intuitive interface and ease of use.
+Mendable.ai discovered that Supabase supports pg_vector and found it to be a simple and cost-effective solution. They were impressed with the open-source nature of Supabase, as well as its ability to store metadata alongside the vectors. They also appreciated the intuitive interface and ease of use.
- We tried other vector databases - we tried Faiss, we tried Weviate, we tried Pinecone. We found them to be incredibly expensive and not very intuitive. If you’re just doing vector search they’re great, but if you need to store a bunch of metadata that becomes a huge pain.
+ We tried other vector databases - we tried Faiss, we tried Weviate, we tried Pinecone. We found
+ them to be incredibly expensive and not very intuitive. If you’re just doing vector search they’re
+ great, but if you need to store a bunch of metadata that becomes a huge pain.
## What They Built
-Using Supabase's pg_vector, [Mendable.ai](http://mendable.ai/) was able to build a more efficient and accurate search function for their AI chatbot. By storing vector data alongside metadata in Supabase, [Mendable.ai](http://mendable.ai/) was able to quickly and easily search through their customers documentation to find the most relevant responses to queries. They found that Supabase's solution was just as performant as dedicated vector databases, but without the high cost.
+Using Supabase's pg_vector, Mendable.ai was able to build a more efficient and accurate search function for their AI chatbot. By storing vector data alongside metadata in Supabase, Mendable.ai was able to quickly and easily search through their customers documentation to find the most relevant responses to queries. They found that Supabase's solution was just as performant as dedicated vector databases, but without the high cost.
## The Results
-Thanks to Supabase's pg_vector, [Mendable.ai](http://mendable.ai/) was able to significantly improve the efficiency and accuracy of their Chat Powered Search for Documentation. They were able to build faster and more cost-effectively using Supabase’s open source stack.
+Thanks to Supabase's pg_vector, Mendable.ai was able to significantly improve the efficiency and accuracy of their Chat Powered Search for Documentation. They were able to build faster and more cost-effectively using Supabase’s open source stack.
## Tech stack
-[Mendable.ai](http://mendable.ai/)'s tech stack includes React, Next.js, Express, Vercel, and Supabase.
+Mendable.ai's tech stack includes React, Next.js, Express, Vercel, and Supabase.
- We looked at the alternatives and chose Supabase because it’s open source, it’s simpler, and, for all the ways we need use it, Supabase has been just as performant - if not more performant - than the other vector databases.
+ We looked at the alternatives and chose Supabase because it’s open source, it’s simpler, and, for
+ all the ways we need use it, Supabase has been just as performant - if not more performant - than
+ the other vector databases.
diff --git a/apps/www/components/Features/index.tsx b/apps/www/components/Features/index.tsx
index b5c8dc3f68f..ab6510718e5 100644
--- a/apps/www/components/Features/index.tsx
+++ b/apps/www/components/Features/index.tsx
@@ -1,12 +1,52 @@
-import { Button, Badge, IconArrowRight } from 'ui'
-import SectionHeader from 'components/UI/SectionHeader'
+import { Badge } from 'ui'
import Solutions from 'data/Solutions.json'
-import Link from 'next/link'
+import Telemetry from '~/lib/telemetry'
+import gaEvents from '~/lib/gaEvents'
import SectionContainer from '../Layouts/SectionContainer'
import ProductIcon from '../ProductIcon'
import TextLink from '../TextLink'
+import { useTelemetryProps } from 'common/hooks/useTelemetryProps'
+import { useRouter } from 'next/router'
const Features = () => {
+ const router = useRouter()
+ const telemetryProps = useTelemetryProps()
+
+ const sendTelemetryEvent = async (product: any) => {
+ switch (product) {
+ case 'Database':
+ return await Telemetry.sendEvent(
+ gaEvents['www_hp_subhero_products_database'],
+ telemetryProps,
+ router
+ )
+ case 'Authentication':
+ return await Telemetry.sendEvent(
+ gaEvents['www_hp_subhero_products_auth'],
+ telemetryProps,
+ router
+ )
+ case 'Storage':
+ return await Telemetry.sendEvent(
+ gaEvents['www_hp_subhero_products_storage'],
+ telemetryProps,
+ router
+ )
+ case 'Edge Functions':
+ return await Telemetry.sendEvent(
+ gaEvents['www_hp_subhero_products_edgeFunctions'],
+ telemetryProps,
+ router
+ )
+ case 'Realtime':
+ return await Telemetry.sendEvent(
+ gaEvents['www_hp_subhero_products_realtime'],
+ telemetryProps,
+ router
+ )
+ }
+ }
+
const IconSections = Object.values(Solutions).map((solution: any) => {
const { name, description, icon, label, url } = solution
if (solution.name === 'Realtime') return null
@@ -24,7 +64,13 @@ const Features = () => {
{label}
)}
- {url && }
+ {url && (
+ sendTelemetryEvent(name)}
+ />
+ )}
)
})
diff --git a/apps/www/components/Hero.tsx b/apps/www/components/Hero.tsx
index e97cd31fa74..d2decb0ab08 100644
--- a/apps/www/components/Hero.tsx
+++ b/apps/www/components/Hero.tsx
@@ -1,10 +1,19 @@
-import { Button, IconBookOpen, Space } from 'ui'
-import Link from 'next/link'
+import { Button, IconBookOpen } from 'ui'
import { useRouter } from 'next/router'
+import Link from 'next/link'
import SectionContainer from './Layouts/SectionContainer'
+import Telemetry, { TelemetryEvent } from '~/lib/telemetry'
+import gaEvents from '~/lib/gaEvents'
+import { useTelemetryProps } from 'common/hooks/useTelemetryProps'
const Hero = () => {
- const { basePath } = useRouter()
+ const router = useRouter()
+ const { basePath } = router
+ const telemetryProps = useTelemetryProps()
+
+ const sendTelemetryEvent = async (event: TelemetryEvent) => {
+ await Telemetry.sendEvent(event, telemetryProps, router)
+ }
return (
+ {requester.name} has read and write access to the organization "
+ {approvedOrganization?.name ?? 'Unknown'}" and all of its projects
+
+
+ Approved on: {dayjs(requester.approved_at).format('DD MMM YYYY HH:mm:ss (ZZ)')}
+
+
+
+
+ )
+ }
+
+ return (
+ Authorize API access for {requester?.name}}
+ footer={
+
+
+
+
+
+
+ }
+ >
+
+ {/* API Authorization requester details */}
+
+
+
+
+
+
{requester?.name[0]}
+
+
+
+
+ {requester?.name} ({requester?.domain}) is requesting API access to an organization. The
+ application will be able to{' '}
+
+ read and write the organization's settings and all of its projects.
+
+