Going live
A view built on fake worlds reaches the people of a real world, agent or lone wolf in two steps. You publish the view on your own server and the owner of the world writes its address in the Own view field of the card of the world under You in the webapp. Nobody approves that address and UNaIVERSE does not check your site. Each person who opens the world decides instead whether to use your view and takes the responsibility for what happens in it.
The path, in short
- You publish your view on your own server over HTTPS with a header that allows the webapp to embed it.
- The owner writes its address in the Own view field on the card of the world, agent or lone wolf in the webapp. The owner is you when the world is yours and your client when you build the view for a world of theirs.
- Each person who opens the world sees the site of your view and what it will receive about them before choosing whether to use it.
You ask UNaIVERSE for nothing and need no account besides the one of the owner.
1. Serve your view
Serve the pages of your view in this way:
over HTTPS with a valid certificate. Everything your page loads must use
https:too.with this header on every page of your view:
httpContent-Security-Policy: frame-ancestors https://unaiverse.ioThe header allows browsers to show your page only inside UNaIVERSE. No other site can then embed your view in its own page and pose as the webapp.
without
X-Frame-Options: DENYorSAMEORIGIN. Some servers and frameworks add this header by default and it forbids the webapp to show your page.at every path that your view writes with
setPathbecause a link with that path makes the webapp load your page directly at it (Links and the back button).
If your server already sends a Content-Security-Policy, add frame-ancestors https://unaiverse.io to it as one more directive separated from the others by a semicolon. Because browsers ignore frame-ancestors in a <meta> tag, the header must come from the server.
nginx
location / {
add_header Content-Security-Policy "frame-ancestors https://unaiverse.io" always;
try_files $uri /index.html;
}Apache (with mod_headers)
Header always set Content-Security-Policy "frame-ancestors https://unaiverse.io"
Header always unset X-Frame-OptionsNode.js with Express
app.use((request, response, next) => {
response.setHeader('Content-Security-Policy', 'frame-ancestors https://unaiverse.io');
response.removeHeader('X-Frame-Options');
next();
});With helmet turn off its X-Frame-Options header and add frameAncestors: ['https://unaiverse.io'] to the directives of its Content Security Policy. Static hosts usually read headers from a file in your project such as _headers or vercel.json (see the documentation of your host).
2. Write the address in the settings
The owner of a world, an agent or a lone wolf opens its card under You in the webapp (Me on a phone), writes the address of the view in the Own view field and presses Save. From then on the webapp offers the view to whoever opens that world. Only the owner sees the field and can change the address. The field takes two kinds of address:
- an
https:address such ashttps://gui.your.site/arena/ - an address on your own computer (
http://localhostorhttp://127.0.0.1with any port, such ashttp://localhost:5173/) to try a view that runs on your computer inside the real webapp.
The field refuses an address on the site of the webapp or on another site of UNaIVERSE. A page from those sites shown inside the webapp could read what the webapp stores for the person. Remove the view (or saving an empty field) takes the view away and brings the world back to the UNaIVERSE view.
Keep the address stable. Each person accepts the view at a given address and a new address makes the webapp ask everyone again. Publish new versions of your view at the same address.
Try it from your computer
During development write the address of your development server (http://localhost:5173/ with Vite) in the Own view field of a world, an agent or a lone wolf of yours and open it in the webapp. The webapp then shows the view from your computer inside the real world with everything that a fake world cannot simulate (the consent, the reload after askFor, the back button and the phone). The developer tools show what happens in your view (Debugging).
The browser of everyone else who opens that world looks for the same address on their own computer. When nothing answers there or the browser blocks an http://localhost page inside an https: one, the person sees the UNaIVERSE view after 20 seconds. Try your view on a world that only you use and write the address of the view on your server once it is ready.
What the people of the world see
The first time a person opens a world with its own view on a device, the webapp asks them to accept the view before any part of it loads. For a world it asks inside the dialog for joining the world or in a separate dialog when the view was added after the person joined. An agent always gets a separate dialog. The dialog does five things:
- it names the site of your view and states that UNaIVERSE does not check it
- it states that the view acts for the person in that world only by sending messages and answering questions (the others see these messages as written by the person because they carry no mark of the view)
- it lists what your view will receive about the person: the nickname in every case and the public fields of the profile that the person ticks (name and surname, title, organization, city and country start unticked)
- it states that your view asks before it uses the camera, the microphone, the location and the other features that the browser remembers
- it states that the person and not UNaIVERSE is responsible for what happens in the view.
The webapp remembers the acceptance and the ticked fields for that world and that address on that device. A new address brings the dialog back. A person who refuses gets the UNaIVERSE view of the world. Acceptance, on the other hand, loads your view and gives it the world and the person as me (Who the person is).
From then on the person sees your view and the switch in the top bar of the world moves them to the UNaIVERSE view of the same world and back at any time. Search results mark the worlds that have a view of their own with Own view.
Who is responsible
UNaIVERSE does not check, approve or host views. Whoever publishes a view on their server and writes its address in a world is responsible for it towards the people who use it. In practice this responsibility covers three things:
- The code and the content of your view are yours even when you build it for the world of someone else.
- The data your view gets are yours to protect. They include the world with its messages and its data, the
meof each person, what people write or do in your view and what your server sees of every visit (such as the IP address). Use them only to show the world and to send messages and request actions on behalf of the person. Give people a privacy notice that they can reach from your view. - Your server is yours to keep safe. If it is attacked, the owner of the world removes the view (Remove the view) until the server is safe again.
In the consent dialog the person, on their side, accepts that what happens in the view is their responsibility. A view that deserves that trust says where it comes from and asks only for what it needs. It never imitates the webapp and never asks for the password of the person.
The kit is released under the Apache License 2.0 (Installation). The license covers the code of the kit. The sections above still hold: whoever publishes a view answers for what it does with the data of people and with its server.
The 20 seconds
From the moment the webapp starts your view, it gives it 20 seconds to connect. A view that misses this limit leaves the person in the UNaIVERSE view. Errors and the person's controls lists the causes, what the person sees and how to connect in time. Your server has to stay up and fast because a site that is down or slow leaves the world without its view.
Updating your view
- Your view: publish the new version at the same address. People who have it open keep the old version until the next load.
- The kit: a view built with an older file of the kit keeps working after an update of the webapp and only lacks the features added since. A new download of the kit brings them (Installation).
- The address: a new address shows every person the first consent again.
Checklist
Before you write the address of your server in Own view:
- The kit is part of your view as the npm package or as the downloaded file.
fakeis gone from the published code or remains only in development builds. connectToHost()is called first when the page starts.- A page opened alone in a tab shows a message with a link to the world instead of an empty page (
'no-host'). - The view is served over HTTPS with
Content-Security-Policy: frame-ancestors https://unaiverse.ioand withoutX-Frame-Options. - Every path written with
setPathloads your view (try one in a new tab). - The text of the world goes into the page with
textContentor JSX and never withinnerHTML. - Every action handles its result and its errors (
'failed'with a retry,'not-allowed'and an error code incatch). - The view follows
webapp.themeandwebapp.languageand looks right in both themes. - On a phone nothing hides under the home bar or the keyboard (
insets,keyboard) and the back button closes what is open. askForis called on a click, the view returns to its place after the reload and a refusal leaves it usable.- The view reads
mewith a fallback for each field and your server never takes the nickname as proof of identity. - People can reach your privacy notice from the view.
- Everything works with an
http://localhostaddress in a world of yours on a desktop and on a phone. It also works with the keyboard alone and with a screen reader.
Next steps
- Errors and the person's controls: what the person can do and how your view responds.
- Debugging: what to inspect when something does not work in the webapp.
- Who the person is:
meand what your server can do with it. - Reference:
connectToHost.