Skip to content

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

added opengraph example

Lakshan Pereraccdf86811302
diff --git a/examples/edge-functions/supabase/functions/opengraph/handler.tsx b/examples/edge-functions/supabase/functions/opengraph/handler.tsx
new file mode 100644
index 00000000000..6a206a09ade
--- /dev/null
+++ b/examples/edge-functions/supabase/functions/opengraph/handler.tsx
@@ -0,0 +1,31 @@
+import React from "https://esm.sh/[email protected]";
+import { ImageResponse } from "https://deno.land/x/og_edge/mod.ts";
+
+export async function handler(req: Request) {
+ return new ImageResponse(
+ <div
+ style={{
+ fontSize: 100,
+ color: "black",
+ background: "white",
+ width: "100%",
+ height: "100%",
+ padding: "50px 200px",
+ textAlign: "center",
+ justifyContent: "center",
+ alignItems: "center",
+ display: "flex",
+ }}
+ >
+ 👋, It works!
+ </div>,
+ {
+ width: 1200,
+ height: 630,
+ // Supported options: 'twemoji', 'blobmoji', 'noto', 'openmoji', 'fluent', 'fluentFlat'
+ // Default to 'twemoji'
+ emoji: "twemoji",
+ },
+ );
+}
+
diff --git a/examples/edge-functions/supabase/functions/opengraph/index.ts b/examples/edge-functions/supabase/functions/opengraph/index.ts
new file mode 100644
index 00000000000..5a7c5c38685
--- /dev/null
+++ b/examples/edge-functions/supabase/functions/opengraph/index.ts
@@ -0,0 +1,6 @@
+import { serve } from "https://deno.land/[email protected]/http/server.ts";
+
+import {handler} from './handler.tsx'
+
+// @ts-ignore
+serve(handler);