Web Apps and sharing
Build a browser app and share it with people you choose.
A Web App lets people use a Handler from a browser. You choose who can open each app. With “共有した人だけ” (Only people you share with), only the owner and people invited by email can open it. This is the setting unless you choose public. With “公開” (Public), anyone who knows the URL can open it without signing in. In this first stage, only AGI Lab members can make an app public. See Make an app public.
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”.
Link previews and icons
Titles, descriptions, images and icons are visible to anyone who knows the app URL. Do not include personal or secret information. For a private app, only the owner and invited people can open the app body. In the Console Web Apps list, open “見え方の設定…” to edit the appearance and see a preview. If you have not set an image, shared links use the default image with your title, but this preview does not show it yet (it shows the Wings card). 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.”
Without an uploaded image, the preview image is a 1200×630 picture of the title (the URL slug when no title is set) in large bold type. Long titles wrap into at most three lines and end with “…” when they do not fit.
Emoji the font does not have and invisible characters are left out. When a character cannot be drawn, such as Hangul, or drawing fails, the 1200×630 Wings card is used instead.
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.
A public app has no entry page, so link previews show what its Handler returns.
A custom favicon is used for public apps too. Without one, the Handler also handles /favicon.ico.
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, and the title image URL changes with the title.
The title image is drawn when a title is saved (at creation, with appearance, in the Console or by a page deploy) or on its first request, which also covers existing apps.
When the Wings card is used instead, it can be cached for 5 minutes and the next request draws the title again.
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 and the title image, but cannot recall copies already delivered.
Titles are drawn with Noto Sans JP Bold, licensed under the SIL Open Font License 1.1.
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. Your own apps open without a confirmation screen. While the app opens, the Console shows its title and the account it is opening it with (in Japanese). To open it with another account, select “別のアカウントでログイン” (Sign in with another account) on that screen, or sign out of the Console and open the app again. Signing out of the Console also ends the app session. If the same app tries to open again within 30 seconds in the same tab, the Console does not open it by itself and shows the confirmation screen with the reason. Select “開く” (Open) to open it. 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.
An invited app shows the confirmation screen only the first time you open it. The screen shows the owner, the address you are signed in with, that opening passes this address to the app, and a link to report the app. Selecting “開く” (Open) remembers your choice for your account and this app, and the app opens without the screen from then on, also in another browser and when you sign in again after 24 hours. You are asked again 365 days after you last signed in to the app. Using the app while you stay signed in does not extend this. You are also asked again after the invitation is removed and you are invited again, after the app is deleted, after the owner's account is suspended or deleted, after an operator stops the app or the owner's sharing (even once lifted), and after you delete your account. A new account that uses the same email address is asked too.
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.
It is also undefined in every Run of a public app, even when the owner opens it.
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.
Make an app public
Anyone who knows the URL of a public app can open it without signing in.
In this first stage, only AGI Lab members can make an app public. Free accounts receive public_unavailable (HTTP 403).
You also cannot make an app public while the operator has turned public apps off.
When your membership ends, your public apps can no longer be opened without signing in, and all of them return to “共有した人だけ” (Only people you share with). Shares are kept, and the choice to allow search engines to list the app is cleared.
Wings switches them as soon as it learns that your membership ended (or started again), for example when a public app is opened, when it checks before making an app public, or when you use the Console, the CLI, or the API. Renewing the membership does not make them public again. Make the apps public again after renewing.
However, if switching an app to private failed, the app can open without signing in again after you renew. And a switch to private that reaches an app late can make it private again after you renewed and made it public again; make it public once more in that case.
Each time a public app is opened, Wings confirms the membership with AGI Lab at most once every 30 seconds. When it cannot be confirmed within 4 seconds, the app returns HTTP 503 and stays public. Wings keeps that answer for 30 seconds too, so during that time all of your public apps return HTTP 503 without waiting for AGI Lab.
Switch an app to public
In the Console Web Apps list, open “公開の設定…” (Access settings) for the app. Choose “公開(URL を知っている人はだれでも)” (Public: anyone with the URL), save, read the confirmation, and select “公開する” (Make public). You can return to “共有した人だけ” (Only people you share with) at any time. Web Apps created in the Console start as “共有した人だけ”.
With the CLI:
wings trigger access <handler-id> <trigger-id> --public
wings trigger access <handler-id> <trigger-id> --public --index
wings trigger access <handler-id> <trigger-id> --public --no-index
wings trigger access <handler-id> <trigger-id> --private
To create an app as public, or to deploy a single page as public:
wings trigger add-web <handler-id> --slug hello-web --public
wings page deploy page.html --name my-page --public
Before an app becomes public, the Console (in Japanese) and the CLI ask you to confirm the following. The CLI shows: “Anyone who knows the URL can open this app without signing in. Every visit runs your Handler with your Connections, Secrets, and Databases and uses your daily run time. Search engines are not allowed to list it unless you allow it, but it is not guaranteed to stay out of search results.”
The CLI asks for confirmation in the terminal. --yes skips it. --yes is required with --json, without a terminal, and when page HTML is read from standard input.
--public on wings page deploy cannot be combined with --share, --no-share, or --private.
To deploy a page shared with nobody, use --no-share. Its earlier name, --private, still works.
--no-share only skips sharing; it does not make the page private. A public page stays public. To switch it back, use wings trigger access <handler-id> <trigger-id> --private.
With the authenticated API, POST /api/v1/wings/handlers/<handler-id>/triggers accepts "public" in config.access and true or false in config.index.
After creation, send a body such as { "access": "public", "index": false, "expected": { "access": "private", "index": false } } to PATCH /api/v1/wings/handlers/<handler-id>/triggers/<trigger-id>/access.
expected is required and holds the current setting you read and confirmed (the Trigger's config.access and config.index).
index is accepted only with "public". When it is omitted, an app that is already public keeps its current choice.
For pages, PUT /api/v1/wings/pages/<name> accepts "access": "public" and "index". Use "noShares": true to deploy a page shared with nobody ("private": true is still accepted).
Making an app public, or allowing search engines to list it, while the operator has stopped it returns web_app_locked (HTTP 423).
A change that widens who can find the app (making it public or allowing search engines to list it) returns access_conflict (HTTP 409) and changes nothing when expected differs from the current setting, another change happened during the switch, or your membership changed during it. Read the setting again and confirm again. The Console and the CLI read it again for you.
Creating an app as public works the same way: on access_conflict no app is created. When a page is deployed as public, the page is written but stays as it was, with the warning access_not_saved. Switching a page back to “共有した人だけ” while it is being deployed always wins.
Switching back to “共有した人だけ” or no longer allowing search engines to list the app always applies.
You can switch back to “共有した人だけ” even while an operator has stopped the app.
What visitors get
- No sign-in is needed. No session or cookie is used.
- The Handler's
env.WINGS_VIEWERis alwaysundefined, even when the owner opens the app while signed in to the Console. - Each visit runs your Handler with your Connections, Secrets, and Databases, and uses your daily run time.
- A link from another Web App opens a public app directly, without the confirmation page. Private apps still show the confirmation page.
- POST requests are accepted only from the app's own pages. Other POST requests receive 403.
- Embedding in an iframe and reads from other sites receive 404.
Set-Cookiefrom the Handler is dropped. Responses useCache-Control: private, no-store.
Anyone can read what a public app returns. Never put Secrets, personal information, or other private data in a public page or response. The Handler does not learn who opened the app. If the app changes data, make sure any visitor can safely use that action.
Limits and run time
Public apps have their own limits, separate from private apps.
They accept 60 requests per minute from one IP address to one app, 300 per minute per app, and 600 per minute across the owner's public apps.
At most 5 requests of one app, and 10 in total across the owner's apps and API Triggers, run at once.
Above these limits, they return HTTP 429 with Retry-After. When too many requests are running at once, Retry-After is 1 second.
Runs of public apps can use at most half of your daily run time. Once that half is used, public apps return HTTP 429 until the next UTC midnight. Schedules, API Triggers, and private apps keep running with the rest. Public apps count toward the Web App limit (100 for members). See also Plans and limits.
Search engines
By default, Web Apps do not allow search engines to list them.
Wings adds X-Robots-Tag: noindex, nofollow to Web App responses, including those of private apps.
Wings answers /robots.txt for every Web App with User-agent: * and Disallow: /, without running the Handler. For private apps too, /robots.txt never reaches the Handler.
This does not guarantee that an app stays out of search results. A search engine that follows Disallow: / does not read the pages, so it does not read noindex either. A URL linked from another site can appear in search results without its content.
Choosing “検索エンジンへの掲載を許可する” (Allow search engines to list it; --index in the CLI, "index": true in the API) allows listing after a confirmation (in Japanese in the Console). The CLI shows: “This allows search engines to list this app. Once listed, people who do not know the URL can find it by searching. Search engines decide whether to list it, so listing is not guaranteed. After you stop allowing it, it can stay in search results.”
When listing is allowed, the app's Handler responses have no X-Robots-Tag, and /robots.txt answers Allow: /. Search engines decide whether and when they list the app.
Even when you allowed listing, it is not allowed while:
- the operator has stopped the app or all of the owner's apps
- the operator has marked the app as under review
- the operator has turned public apps off
- the account is suspended
- the app is disabled
Switching the app back to “共有した人だけ” clears the choice. When it is made public again, listing starts as not allowed. Pages already listed can stay in search results after you stop allowing listing.
Report page
Every public app has a /_wings/report page served by Wings. It does not run the Handler or create a Run.
It explains that the app was made by an AGI Wings user, not by AGI Lab, and how to report harmful content by email.
Send reports to lab@tempi.co.jp with the subject “[AGI Wings Security] Web アプリの報告”.
The Console shows the page's URL in “公開の設定…”.
The page also opens from a link in another Web App.
Wings does not add a link to your pages. Private apps answer 404 there.
Shares and stopping an app
Making a private app public ends its sessions and sign-in codes at once. Its shares are kept. While the app is public, it does not appear in “招待されている Web アプリ” (Invited Web Apps) for invited people. You can still add and remove shares. When you switch it back to “共有した人だけ”, invited people can open it again. Sign-in is required from the next request.
A disabled public app, or one the operator has stopped, returns 404. It does not redirect to sign-in. While the operator has turned public apps off, public apps return HTTP 503. Private apps keep working.
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. The owner and people who have confirmed opening the app open it and sign in without a click, even from a link on another site.
- 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.