Origin Trials: Testing Experimental APIs With Real Users
Yellow APIs are experimental — they might change, get removed, or need a flag to work. Origin trials are how Chromium lets you test them with real users in production.
Beyond the stable green and light-green APIs, there is a third tier: yellow APIs. These are experimental. The spec might change. The function names might change. They might never ship at all. And in many cases, you have to explicitly opt in before the browser will even let you use them.
Enabling Experimental Features
There are two ways to opt in, depending on how far along an API is.
Browser flags are the simpler option. In Chrome, go to chrome://flags. In Edge, it is edge://flags. In Safari on Mac, the Develop menu has an Experimental Features submenu. You find the feature you want, flip the toggle, and it is available for your session. This is fine for local exploration and development. Your users never see any of this -- they would have to enable the same flag themselves on their own device for it to work for them.
Origin trials are a different idea entirely, and the more interesting one.
What an Origin Trial Is
Testing an API on your own machine is useful, but it is not the same as seeing how it behaves under real traffic, with real users, on real devices. Origin trials exist to close that gap.
The concept comes from the Chromium team (Google Chrome and Microsoft Edge). Firefox has started running origin trials too, though with fewer available APIs. Safari does not have origin trials -- its equivalent is the Experimental Features flag, which each user has to enable themselves.
Here is how the process works:
- You visit the active Chrome Origin Trials page and find an API you want to test.
- You register with your domain (your origin) and a Google account.
- You receive a token specific to your domain.
- You embed that token in your HTML as a
<meta>tag or as an HTTP response header. - From that point, any user visiting your site on a compatible Chrome version gets access to the experimental API automatically -- no flags, no settings, no action required on their end.
The token is tied to your domain on purpose. An origin trial is not a global switch that turns on a feature for everyone. It is a targeted experiment for your specific origin.
What Happens When the Trial Ends
Every origin trial has an expiry date. When it ends, one of three things happens:
- The API ships as stable. The trial collected enough positive signal, the spec is solid, and the feature becomes part of the browser without any token or flag needed.
- Another trial begins. Feedback led to changes in the spec or the API shape. A new trial starts for the updated version.
- The API is dropped. It did not get enough adoption, feedback was negative, or the approach turned out to be wrong. The feature disappears entirely.
This is worth keeping in mind if you ever use an origin trial in production. You are betting on a feature that may not exist by its expiry date. That is sometimes a reasonable bet -- if you know the API is likely to ship and the trial is nearly done -- but you need to have a fallback plan regardless.
Edge's Angle
Microsoft Edge has its own set of origin trials on top of Chromium's, mostly focused on desktop and Windows-specific features. If you are building a desktop PWA and want to test bleeding-edge OS integration, that is where to look. Some of those trials never make it into Chrome at all -- they are Edge-specific proposals targeting Windows capabilities.
Practice
0/6 doneKeep reading
Enjoyed this? Get more like it.
Deep dives on system design, React, web development, and personal finance — straight to your inbox. Free, always.