Skip to content

Web Apps and sharing

Build a browser app and share it with people you choose.

Applies to
CLIConsoleAPI

Verified · v1.4.24

Markdown

A Web App lets people use a Handler from a browser. Only the owner and people invited by email can open it. There is no public mode that lets anyone in.

1. Save the code

Save this as hello-web.js:

export default {
  async fetch(request, env) {
    return new Response('<!doctype html><h1>Hello, Wings</h1>', {
      headers: { 'Content-Type': 'text/html; charset=utf-8' },
    })
  },
}

2. Create the Web App

wings handler deploy --name hello-web --file hello-web.js
wings handler list

Replace <handler-id> with the ID from the list. Then create a Web App and get its URL:

wings trigger add-web <handler-id> --slug hello-web --title "Hello, Wings" --description "A shared workspace"
wings trigger list <handler-id>
wings trigger url <handler-id> <trigger-id>

Replace <trigger-id> with the ID from the Trigger list. Open the returned URL in your browser and sign in through the Console. You should see “Hello, Wings”.

Titles, descriptions, images and icons are visible to anyone who knows the app URL. Do not include personal or secret information. The app body remains private to the owner and invited people. In the Console Web Apps list, open “見え方の設定…” to edit the appearance and see a preview. You can also set a title and description when creating the app.

wings trigger appearance <handler-id> <trigger-id> --title "Team notes" --description "A shared workspace"
wings trigger appearance <handler-id> <trigger-id> --og-image card.png --favicon icon.png
wings trigger appearance <handler-id> <trigger-id> --title "" --description "" --clear-og-image --clear-favicon
wings trigger appearance <handler-id> <trigger-id> --json

add-web accepts the same --title, --description, --og-image and --favicon flags. Titles allow 120 Unicode characters and descriptions 300. Newlines, control characters and bidi overrides are rejected. Clearing a title restores the URL slug; clearing a description restores the Japanese equivalent of “Only the owner and invited people can use this Web App. Sign in with your AGI Lab account.” The default image is a 1200×630 Wings card and the default favicon is the Wings icon. Wings never extracts titles from authenticated Handler HTML.

Upload Formats Limits
OG image PNG, JPEG, WebP 512 KiB, 4096 pixels per side, 4,194,304 pixels
Favicon ICO, PNG, JPEG, WebP 128 KiB, 512 pixels per side; ICO: at most 16 frames, each up to 256×256

SVG, animated PNG/WebP and external URLs are rejected. Wings checks the image bytes. Images are served without sign-in from the app's /_wings/appearance/ routes without starting a Handler or Run. A custom favicon also serves /favicon.ico before and after sign-in. Without a custom icon, signed-out requests get the Wings icon and signed-in requests still reach the Handler.

Browsers and bots get the same entry page before sign-in. It contains no app body, invited addresses or owner information. Script immediately proceeds to sign-in, with a link as a fallback. Disabled, operator-locked, sharing-stopped, suspended-owner and deleted-owner apps expose no appearance information. Entry pages and text updates are not cached; image URLs change with their content hash. Images can be cached for one year. Social services may keep an older preview until their own cache refreshes. Deleting the app, Handler or account erases Wings uploads, but cannot recall copies already delivered.

The authenticated API accepts config.appearance when creating a Trigger with POST /api/v1/wings/handlers/<handler-id>/triggers. After creation, use GET / PATCH /api/v1/wings/handlers/<handler-id>/triggers/<trigger-id>/appearance. A PATCH body is { "title": "Team notes", "description": "A shared workspace" }; null or empty strings clear text. Upload with PUT to the same path plus /image or /favicon, using JSON { "data": "<base64>" }. DELETE clears the upload.

Signing in and out

An app session lasts 24 hours. Signing out of the Console normally signs you out of the app too. If you see a warning that Web App sign-out failed, the app session may remain active for up to 24 hours. Check for that warning when using a shared computer.

Disabling or deleting the app also ends its sessions. Removing a share ends that person's sessions. Disabling keeps the sharing settings; deleting the app removes them.

Invite people

wings trigger share <handler-id> <trigger-id> --email teammate@example.com
wings trigger shares <handler-id> <trigger-id>
wings trigger unshare <handler-id> <trigger-id> --email teammate@example.com

Wings does not send invitation emails. The app appears in the person's Console. You can also give them this URL directly. They sign in with an AGI Lab account using the invited address. A free account is enough. Viewing the app does not create a Wings workspace or start their Free allowance.

Open an invited Web App

In the Console, open Web Apps and find “招待されている Web アプリ” (Invited Web Apps). Apps appear even before your first visit, separately from “自分が作った Web アプリ” (Your Web Apps). Check the appearance title (or URL slug when unset), owner, role and status, then select “開く” (Open). The owner's email is the same one shown on the confirmation screen before opening the app. “利用者” (Member) means you can use the app through its owner's Handler; it does not grant app or sharing management.

The list contains only invitations matching your signed-in account's verified email. If invited at a different address, sign in with the account using that address. Other invited people's information is never shown. Select “更新” (Refresh) to reload the list. Revoked invitations, deleted or disabled apps, operator-locked apps, sharing stops, and apps of suspended or deleted owners are omitted. If you use the same email address as a deleted account, invited apps do not appear in the list for 30 days after that account's deletion. Wings sends no invitation email. Open an app from this list or a URL its owner gives you.

The Console uses authenticated GET /wings/api/web-apps/invited. OAuth clients can read the same list at GET /api/v1/wings/web-apps/invited. Its data.webApps contains only title (the appearance title, or the URL slug when unset), titleConfigured (whether a title is set), owner.email, your role (member), url and status (available). Unavailable apps are omitted.

Invitation limits

Limit Free Member
People per app 5 20
Distinct addresses across the account 20 100
Additions in the last 24 hours 30 30

Removing a share does not reduce the number of additions in the last 24 hours. Use shares to check the current count and limits. If you receive sharing_unavailable, this account cannot add shares yet. You can still list and remove them.

Decide what invited people can do

Invited people run the owner's Handler. Through that Handler, they use the owner's Connections, Secrets, and Databases. Their use also counts toward the owner's time allowance. Check permissions on actions that change data, as well as on what the page displays.

Use env.WINGS_VIEWER to identify the viewer. It contains email and role: owner for the owner, or member for an invited person. The Handler cannot change this value. It is undefined in other Runs and in child Handlers.

Web App Runs do not count against the per-minute or per-hour Run limits. They do use the daily time allowance and the separate Web App access limits.

Development limits

  • Each app has its own address under agi-wings.app. Its root is /.
  • GET, HEAD, and POST are supported. Send POST requests from the app's own pages.
  • Requests are limited to 256 KiB and responses to 1 MiB. /_wings/ is reserved for the service.
  • Do not change data on GET.
  • Service Workers, embedding in an iframe, and fetches from other apps are not supported.
  • App and entry pages use private, no-store; public appearance images use the cache policy above.
  • Redirects must stay within the same app. Redirects to external sites are rejected.

If a Web App stops opening

Cookies saved by another app can prevent Web Apps from opening. Clearing the site data for agi-wings.app in your browser's settings may fix this.

Clearing site data also deletes localStorage. Keep data you need to retain in a Database.

Use env.WINGS_VIEWER for authentication instead of your own cookies. Another app on the same site can overwrite cookies created with JavaScript.

Web Apps and sharing | AGI Wings Documentation