Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

add umd bundle example

Pham Hieu4d669f54ffce
diff --git a/web/src/pages/index.js b/web/src/pages/index.js
index 244707ca209..84cd8138a00 100755
--- a/web/src/pages/index.js
+++ b/web/src/pages/index.js
@@ -107,6 +107,29 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
};
`.trim()
+const umdExample = `
+<script src="https://unpkg.com/@supabase/supabase-js/umd/supabase.js"></script>
+
+<script>
+ // Initialize
+ const supabaseUrl = 'https://chat-room.supabase.co'
+ const supabaseKey = 'public-anon-key'
+ const supabase = Supabase.createClient(supabaseUrl, supabaseKey)
+
+ // Get public rooms and their messages
+ supabase
+ .from('rooms')
+ .select(\`
+ name,
+ messages ( text )
+ \`)
+ .eq('public', true)
+ .then(response => {
+ // do s.th with the response
+ })
+</script>
+`.trim()
+
const features = [
{
title: <>Chat apps</>,
@@ -371,6 +394,14 @@ function Home() {
>
Node.js & TypeScript support
</button>
+ <button
+ className={`button button--${
+ visibleCodeExample === 'NODETS' ? 'info is-active' : 'info '
+ }`}
+ onClick={() => showCodeExample('UMD')}
+ >
+ UMD bundle support
+ </button>
</div>
</div>
<div className="col col--9 code-with-header">
@@ -398,6 +429,12 @@ function Home() {
js={nodeTSExample}
/>
)}
+ {visibleCodeExample === 'UMD' && (
+ <CustomCodeBlock
+ header="Supabase-js standalone bundle"
+ js={umdExample}
+ />
+ )}
</div>
</div>
</div>