Other Functions

Start with a small endpoint that proves the browser, gateway, and Functions runtime can talk to one another.

hello-world

The starter endpoint returns a message, request method, and server timestamp. Use it before adding real backend logic.

// supabase/functions/hello-world/index.ts
Deno.serve((request: Request) => {
  return Response.json({
    ok: true,
    message: "Hello from your ChromeShip backend.",
    method: request.method,
    servedAt: new Date().toISOString(),
  });
});

Invoke from your extension

Call functions.invoke from any surface — auth tokens are attached automatically:

import { functions } from "@/integrations/supabase";

const result = await functions.invoke("hello-world", { name: "World" });
// { ok: true, message: "Hello...", method: "POST", servedAt: "..." }

Creating your own

Click Add function, choose a name, and edit the generated Deno handler. Keep database work, external API calls, and other secret-dependent logic here, then deploy from the same tab.