The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
small refactors
Joshen Lim30a1bf078523
diff --git a/apps/www/data/Footer.json b/apps/www/data/Footer.jsonindex cd224f9b182..bc567325dd5 100644--- a/apps/www/data/Footer.json+++ b/apps/www/data/Footer.json@@ -62,6 +62,10 @@{"text": "DPA","url": "/legal/dpa"+ },+ {+ "text": "SOC2",+ "url": "/legal/soc2"}]},diff --git a/apps/www/pages/legal/dpa.tsx b/apps/www/pages/legal/dpa.tsxindex 644976153c3..746aedf0e03 100644--- a/apps/www/pages/legal/dpa.tsx+++ b/apps/www/pages/legal/dpa.tsx@@ -1,43 +1,36 @@+import * as Yup from 'yup'+import Link from 'next/link'+import { useState } from 'react'import { Button, Form, IconDownload, Input } from '@supabase/ui'++import supabase from '~/lib/supabase'import CTABanner from 'components/CTABanner/index'-import { useState } from 'react'import Layout from '~/components/Layouts/Default'import SectionContainer from '~/components/Layouts/SectionContainer'-import supabase from '~/lib/supabase'-import * as Yup from 'yup'const DPA = () => {- const [email, setEmail] = useState('')- const [error, setError] = useState('')- const [message, setMessage] = useState('')- const [formSubmitted, setFormSubmitted] = useState(false)+ const [email, setEmail] = useState<string>('')+ const [error, setError] = useState<string>()+ const [formSubmitted, setFormSubmitted] = useState<boolean>(false)- const INITIAL_VALUES = {- email: '',- }+ const INITIAL_VALUES = { email: '' }const FormSchema = Yup.object().shape({email: Yup.string().email('Invalid email').required('Required'),})const handleFormSubmit = async (values: typeof INITIAL_VALUES, { resetForm }: any) => {- console.log('handleFormSubmit ran')+ console.log('handleFormSubmit ran', values)try {- setError('')-- const { error } = await supabase.from('dpa_downloads').insert([- {- contact_email: values.email,- document: 'dpa',- },- ])+ setError(undefined)+ const { error } = await supabase+ .from('dpa_downloads')+ .insert([{ contact_email: values.email, document: 'dpa' }])if (error) throw errorresetForm()setFormSubmitted(true)- setMessage('A new tab should have opened with the DPA document')-window.open('https://supabase.com/downloads/docs/legal/dpa.pdf', '_blank')} catch (error: any) {setError(error.message)@@ -57,10 +50,16 @@ const DPA = () => {("DPA").</p>- <p>You can download the latest DPA document through our security portal.</p>+ <p>+ You can download the latest DPA document through our{' '}+ <Link href="https://security.supabase.com/">security portal</Link>, or by+ submitting your email here.+ </p>- {message ? (- <p className="text-brand-900">{message}</p>+ {formSubmitted ? (+ <p className="text-brand-900">+ A new tab should have opened with the DPA document+ </p>) : (<ForminitialValues={INITIAL_VALUES}@@ -90,7 +89,6 @@ const DPA = () => {</Button>}/>- {formSubmitted && <p>A new tab should have opened with the DPA document</p>}{error && <p>{error}</p>}</>)}diff --git a/apps/www/pages/legal/soc2.tsx b/apps/www/pages/legal/soc2.tsxindex 607e759fca2..f33c12b6ebf 100644--- a/apps/www/pages/legal/soc2.tsx+++ b/apps/www/pages/legal/soc2.tsx@@ -1,108 +1,103 @@-import { Button, Form, IconDownload, Input } from '@supabase/ui'-import CTABanner from 'components/CTABanner/index'+import * as Yup from 'yup'+import Link from 'next/link'import { useState } from 'react'+import { Button, Form, Input } from '@supabase/ui'++import supabase from '~/lib/supabase'+import CTABanner from 'components/CTABanner/index'import Layout from '~/components/Layouts/Default'import SectionContainer from '~/components/Layouts/SectionContainer'-import supabase from '~/lib/supabase'-import * as Yup from 'yup'-const DPA = () => {- const [email, setEmail] = useState('')- const [error, setError] = useState('')- const [message, setMessage] = useState('')- const [formSubmitted, setFormSubmitted] = useState(false)+const SOC2 = () => {+ const [email, setEmail] = useState<string>('')+ const [error, setError] = useState<string>()+ const [formSubmitted, setFormSubmitted] = useState<boolean>(false)- const INITIAL_VALUES = {- email: '',- }+ const INITIAL_VALUES = { email: '' }const FormSchema = Yup.object().shape({email: Yup.string().email('Invalid email').required('Required'),})const handleFormSubmit = async (values: typeof INITIAL_VALUES, { resetForm }: any) => {- console.log('handleFormSubmit ran')+ console.log('handleFormSubmit ran', values)try {- setError('')-- const { error } = await supabase.from('soc2_downloads').insert([- {- contact_email: values.email,- document: 'soc2',- },- ])+ setError(undefined)+ const { error } = await supabase+ .from('soc2_downloads')+ .insert([{ contact_email: values.email, document: 'soc2' }])if (error) throw errorresetForm()setFormSubmitted(true)- setMessage('A new tab should have opened with the DPA document')-- window.open('https://supabase.com/downloads/docs/legal/dpa.pdf', '_blank')} catch (error: any) {setError(error.message)}}return (- <>- <Layout>- <SectionContainer>- <div className="mx-auto grid max-w-2xl grid-cols-12 rounded-lg">- <div className="col-span-12 flex items-center lg:col-span-12">- <div className="prose flex flex-col space-y-8 p-16">- <h1 className="text-center text-5xl">SOC2</h1>- <p>- We have a long-standing commitment to customer privacy and data protection, and as- part of that commitment we have prepared a pre-signed Data Processing Addendum- ("DPA").- </p>+ <Layout>+ <SectionContainer>+ <div className="mx-auto grid max-w-2xl grid-cols-12 rounded-lg">+ <div className="col-span-12 flex items-center lg:col-span-12">+ <div className="prose flex flex-col space-y-8 p-16">+ <h1 className="text-center text-5xl">SOC2</h1>+ <p>+ As a database company, being SOC2 compliant is important when handling sensitive+ customer data. Supabase is currently SOC2 Type 1 compliant and we're also working on+ getting certified for SOC2 Type 2 and HIPAA next.+ </p>- <p>You can download the latest DPA document through our security portal.</p>+ <p>+ You can request for our latest SOC 2 document through our{' '}+ <Link href="https://security.supabase.com/">security portal</Link>, or by submitting+ your email here.+ </p>- {message ? (- <p className="text-brand-900">{message}</p>- ) : (- <Form- initialValues={INITIAL_VALUES}- validationSchema={FormSchema}- onSubmit={handleFormSubmit}- >- {({ isSubmitting }: any) => (- <>- <Input- value={email}- onChange={(e) => setEmail(e.target.value)}- type="email"- name="email"- id="email"- required- descriptionText="We only keep a record of your email so we can update you when the document has been updated."- placeholder="Your email address"- error={error}- actions={- <Button- htmlType="submit"- type="default"- iconRight={<IconDownload />}- loading={isSubmitting}- >- Download DPA document- </Button>- }- />- {formSubmitted && <p>A new tab should have opened with the DPA document</p>}- {error && <p>{error}</p>}- </>- )}- </Form>- )}- </div>+ {formSubmitted ? (+ <p className="text-brand-900">+ Thank you for your submission! A member from the Supabase team will reach out to+ you shortly!+ </p>+ ) : (+ <Form+ initialValues={INITIAL_VALUES}+ validationSchema={FormSchema}+ onSubmit={handleFormSubmit}+ >+ {({ isSubmitting }: any) => (+ <>+ <Input+ value={email}+ onChange={(e) => setEmail(e.target.value)}+ type="email"+ name="email"+ id="email"+ required+ descriptionText="We only keep a record of your email so we can update you when the document has been updated."+ placeholder="Your email address"+ actions={+ <Button+ htmlType="submit"+ type="default"+ loading={isSubmitting}+ className="mr-1"+ >+ Request SOC2 document+ </Button>+ }+ />+ {error && <p>{error}</p>}+ </>+ )}+ </Form>+ )}</div></div>- </SectionContainer>- <CTABanner />- </Layout>- </>+ </div>+ </SectionContainer>+ <CTABanner />+ </Layout>)}-export default DPA+export default SOC2diff --git a/apps/www/supabase/functions/hubspot-notification/index.ts b/apps/www/supabase/functions/hubspot-notification/index.tsindex ca145b47410..220cd3258c8 100644--- a/apps/www/supabase/functions/hubspot-notification/index.ts+++ b/apps/www/supabase/functions/hubspot-notification/index.ts@@ -4,6 +4,8 @@ const FUNCTION_SECRET = Deno.env.get('FUNCTION_SECRET')const HUBSPOT_PORTAL = Deno.env.get('HUBSPOT_PORTAL')const PARTNER_FORM_ID = Deno.env.get('PARTNER_FORM_ID')const ENTERPRISE_FORM_ID = Deno.env.get('ENTERPRISE_FORM_ID')+const DPA_FORM_ID = Deno.env.get('DPA_FORM_ID')+const SOC2_FORM_ID = Deno.env.get('DPA_FORM_ID')serve(async (req) => {const requestSecret = req.headers.get('x-function-secret')@@ -28,39 +30,29 @@ serve(async (req) => {const partner_gallery_type = input.record.typeconst document = input.document- let formData: object = {- email,- }-- if (input.table === 'partner_contacts') {- formData = {- ...formData,- jobtitle,- website,- partner_gallery_type,- }- }+ let formData: object = { email }- if (input.table === 'enterprise_contacts') {- formData = {- ...formData,- supabase_table_id,- country,- form_note,- company,- company_size,- email,- phone,- lastName,- firstName,- }- }-- if (input.table === 'dpa_downloads') {- formData = {- ...formData,- document,- }+ switch (input.table) {+ case 'partner_contacts':+ formData = { ...formData, jobtitle, website, partner_gallery_type }+ break+ case 'enterprise_contacts':+ formData = {+ ...formData,+ supabase_table_id,+ country,+ form_note,+ company,+ company_size,+ email,+ phone,+ lastName,+ firstName,+ }+ break+ case 'soc2_downloads':+ case 'dpa_downloads':+ formData = { ...formData, document }}const fields: { objectTypeId: '0-1'; name: string; value: string }[] = []