Skip to Content
FunctionsCreate a Site Members Function
On this page

Create a Site Members Function

A Site Members Function is a MiniUp Function linked to one MiniUp Site. It uses the Site’s authenticated members and roles so browser code can call a secure backend without embedding a Function API key.

Create a Site Members Function

  1. Sign in as the Site owner and open Dashboard → your Site → Functions.
  2. Create a Function and choose its name and slug, such as my-app-api.
  3. Write the handler and use env.MINIUP_USER for trusted member identity.
  4. Test a request in the editor, then Publish.
  5. Open the actual linked Site as a member and call the Function with a relative URL.
const response = await fetch("/api/functions/my-app-api/bootstrap"); if (!response.ok) throw new Error(`App request failed: ${response.status}`); const app = await response.json();

Implement /bootstrap in your Function before calling it. It is an application design pattern, not an automatic endpoint.

Understand the linked Site boundary

A Site Members Function is linked to one Site. A copied URL on another Site is not a substitute for that link. If a Function is no longer linked or the linked Site is unavailable, inspect its access settings and restore an appropriate owned Site link.

Site Access and Function access serve different purposes. A Public Site can show a public landing page while its Site Members Function still requires authenticated membership. A Password Site’s shared password does not create a member identity. Use Invite-only or Private when the frontend files themselves should require membership.

Test member authorization

Test from the published Site as Owner, as a lower-privilege member, and while signed out. The editor’s preview does not replace this test. Each protected operation must check the trusted role and any record-specific permission in the Function.

Site Members Function · linked site · site-scoped Functions · member · role · MINIUP_USER