Skip to content

Authentication and Permissions

Forge Actions and Pages for an organization are accessible only through the Forge dashboard.

INFO

Currently, only authenticated users can access Forge apps. We are looking into allowing public Forge apps.

Forge SDK

The Forge SDK authenticates with the Forge server via API keys. The API keys are tied to individual environments within an organization.

Roles

Forge assigns each user one of three roles:

  • Admins: Can manage users, teams, Live API keys, and environments.
  • Developers: Can run actions and view pages in Live mode; can develop in Dev mode but cannot create Live API keys.
  • Members: Can run actions and view pages in Live mode.

INFO

Roles are assigned in the Users section of the dashboard.

Permissions

By default, all users in your organization can access actions.

Forge allows the creation of Teams (e.g., Support, Engineering) within the organization. Teams can be set up in the Teams section of the Forge dashboard. You can then restrict access to actions or pages to specific teams.

INFO

Only non-development environments enforce permissions.

Setting Permissions in Code

To control access in code, use the access property when defining an action or page, and reference team slugs from Settings > Teams.

Permissions follow a top-down hierarchy:

  • If no access is defined, Forge will check up the hierarchy to the root page
  • If no restriction is specified, access defaults to the entire organization.

INFO

"entire-organization" is a special key for giving the entire organization access to the Forge app.

Example: Restricting Access by Team

ts
import { Action, Page } from "@forgeapp/sdk";

export const marketingPage = new Page({
  name: "Marketing Admin Dashboard",
  access: { teams: ["marketing"] },
  handler: async () => {
    return new Layout({
      title: "Admin Dashboard",
      description: "dashboard for admin tools",
      menuItems: [],
      children: [],
    })
  },
});

export const sendPromoForm = new Action({
  access: "entire-organization",
  handler: async () => {
    // your action code
  },
});
python
from forgeapp_sdk import Page, IO

dashboard_page = Page(name="Marketing Admin Dashboard")

@dashboard_page.handle
async def dashboard_page_handler(display: IO.Display):
    return Layout(
        title="Admin Dashboard",
        description="dashboard for admin tools",
        menu_items = [],
        children = [],
    )

@dashboard_page.action
async def delete_user(io: IO):
    # your action code

forge.routes.add("admin-dashboard", dashboard_page)