webrtc-adapter: a shim for behaviour differences, not just prefixes
Shim to insulate apps from spec changes and prefix differences. Latest adapter.js release:
At a glance
- What is it?
- The WebRTC compatibility shim, now maintained outside the WebRTC organisation and published from a version string that is ahead of its newest tag. What it actually patches has shifted over the years, and the release process runs through three branches.
- Who is it for?
- Take webrtc-adapter if you are shipping WebRTC to more than one browser engine and want the shimming decisions made for you, and take the npm package rather than a copied file so you can pick up fixes. Check three things first.
- Can I use it commercially?
- Yes. BSD-3-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 33 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- webrtcHacks/adapter3,747 ★ · +0
| Repository | 2026-09-24 | 2026-11-15 |
|---|---|---|
| webrtcHacks/adapter | 3.7k | 3.7k |
0 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Prefixes are mostly gone, so the shim now patches behaviour
The stated purpose has narrowed over the project's life and the page is candid about it: the prefix differences are mostly gone these days, but differences in behaviour between browsers remain. That reframes what the package is. It is not there to make an old Chromium build accept a method it was missing, it is there to make engines that both implement the current spec behave consistently at the edges. After installation the only thing you do is import it, with `import adapter from 'webrtc-adapter';`, and no further action is required. What you can read back is `adapter.browserDetails.browser`, which detects which quirks are required and resolves engines into coarse families, meaning Opera and the Chromium-based Edge both come back as `chrome`, and `adapter.browserDetails.version`, which reports the version according to the user-agent string rather than from the engine itself.
The manifest says 9.0.6 while the newest tag is v9.0.5
The repository has moved away from where it started, and the numbering shows it. This repository used to be part of the WebRTC organisation on GitHub but moved, with the stated aim of keeping the old repository updated with new releases. The three most recent tags are v9.0.5 from 2026-04-18, v9.0.4 from 2026-02-22, and v9.0.2 from 2025-04-18. The package manifest in the tree declares `9.0.6`. So the version in `package.json` is one ahead of anything tagged, which is the normal state of a branch between releases rather than a mistake, and the last push to the branch was 2026-09-07. Anything pinning a version should pin a tag, not read the manifest, and the two sources will disagree until the next release closes the gap. Note also that v9.0.3 never appears in the tag sequence between v9.0.2 and v9.0.4, so the numbering has skipped at least once.
The two CDN URLs on the page point at different hosts
Prebuilt files are served from a `gh-pages` branch rather than from npm or bower, and the page gives two URLs for the same artefact. The prebuilt section says the latest version can be found at `https://webrtc.github.io/adapter/adapter-latest.js`, while the homepage recorded for this repository is `https://webrtcHacks.github.io/adapter/adapter-latest.js`, under the current owner rather than the old organisation. Both are described as serving the same `adapter-latest.js` file, and only the first explains the versioning scheme, where a specific release is `adapter-N.N.N.js` for example `adapter-1.0.2.js`. Anyone wiring this into a build should decide deliberately which host to trust rather than copying the first URL they find, since the point of a shim is that it is loaded before your application code and a stale copy on the wrong host is exactly the failure it is supposed to prevent.
Four files land in node_modules, and only two are global
What you get depends on how you installed it. The npm route fills the `node_modules/webrtc-adapter/out/` folder with four files, of which two are named on the page.
npm install webrtc-adapter`adapter.js` includes all the shims and is visible in the browser under the global `adapter` object, meaning `window.adapter`. `adapter_no_global.js` is the same thing but is not exposed, so you cannot call or interact with the shims from the browser at all. Which one you want depends on whether anything else on the page needs to reach in: a diagnostic script reading `adapter.browserDetails` needs the global build, while a bundled application that only wants the patching does not. From bower the file lands at `bower_components/webrtc-adapter/`. For a plain script include the page says to copy the file to the desired location in your source tree or use a minify or vulcanize tool, and notes that `node_modules` is usually not published with the code.
Only Linux is tested, and the page says Windows will not work
The most consequential line on the whole page is a caveat, not a feature: currently only tested on Linux, not sure about Mac but will definitely not work on Windows. That sits inside the release instructions, so it is describing the maintainer's own environment for producing a release rather than the runtime requirements of the shim, and the distinction matters, since a browser shim has no platform requirement of its own. What it does tell you is that a release can be cut without any signal from macOS or Windows, so a behavioural regression on those platforms is not something the release process would catch. The project also supports two package managers. Npm is `npm install webrtc-adapter`, bower is `bower install webrtc-adapter`, and a `bower.json` is still maintained at the repository root alongside the npm manifest.
A release rewrites gh-pages and repoints the latest symlink
Publishing is a documented sequence rather than a CI action, and its steps show how much state the release depends on. The `preversion` script stashes your work, installs and updates dependencies, runs the unit and browser tests with `CI=true`, then creates and force-pushes a `bumpVersion` branch, builds with grunt, copies the artefacts into `release/`, and commits them. The `postversion` script then switches to `gh-pages`, pulls, copies the built file in, creates a versioned copy, deletes `adapter-latest.js` and recreates it as a symlink to the versioned file, writes a variants folder, and pushes. The manual checklist adds `npm version <version> -m 'bump to %s'`, a PR, and a `git tag` edited in the GitHub interface with a summary and a diff link. A separate hotfix path checks out the tag, cherry-picks fixes, publishes from `bumpVersion` without merging back, and then fixes the dist-tag so `latest` still points at the highest version.
Tests split into jest units and karma browser runs
The scripts section separates the two test layers, and the split tells you where a behavioural change would be caught. `npm test` runs the full chain: grunt, then `jest test/unit`, then `karma start test/karma.conf.js`. There is also `lint-and-unit-tests`, which stops after the jest stage, and `e2e-tests`, which is the grunt and karma path without the units. The browser stage runs against a real browser rather than a simulated one, and the environment is parameterised, since the preversion script sets `BROWSER=chrome`, `BVER=stable`, and `CI=true`. That combination of an environment variable for the browser, another for its version channel, and a CI flag means the matrix is configured externally rather than enumerated in the repository. The build itself is grunt driven through a `Gruntfile.js`, `prepare` runs `grunt build` on install, and `prepublishonly` runs the test suite, so a publish is gated twice.
Editorial conclusion
Take webrtc-adapter if you are shipping WebRTC to more than one browser engine and want the shimming decisions made for you, and take the npm package rather than a copied file so you can pick up fixes. Check three things first. The package manifest reads version 9.0.6 while the newest release tag is v9.0.5, so the tree and the published releases are on different numbering. The two documented CDN URLs disagree with each other, since the recorded homepage and the release link point at different hosts. And the release checklist states the maintainer only tests on Linux and doubts it will work on Windows, which is the single most important operational fact on the page for anyone maintaining this themselves.
Frequently asked questions
How do you install the WebRTC adapter shim?
Through npm with `npm install webrtc-adapter`, or through bower with `bower install webrtc-adapter`. Prebuilt files are also published on the gh-pages branch as adapter-latest.js and versioned adapter-N.N.N.js files.
What is the current version of webrtc-adapter?
The package manifest in the repository declares 9.0.6, while the newest release tag is v9.0.5 from 2026-04-18, preceded by v9.0.4 and v9.0.2. Pin a tag rather than reading the version field, since the two disagree between releases.
Which file should I include from the webrtc-adapter npm package?
adapter.js exposes every shim under the global adapter object on window, while adapter_no_global.js contains the same shims without exposing them. Both sit in the out folder, and bower installs the file under bower_components/webrtc-adapter/.
Does webrtc-adapter work on Windows and macOS?
The release instructions state that only Linux is tested, that the maintainer is unsure about Mac, and that it will definitely not work on Windows. That refers to the maintainer's release environment rather than a runtime requirement of the browser shim.
How do I detect which browser engine webrtc-adapter found?
Read adapter.browserDetails.browser for the engine family, which resolves Opera and the Chromium-based Edge to `chrome`, and adapter.browserDetails.version for the version parsed from the user-agent string. The page notes that neither engine name nor prefix differences are reliable on their own.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/webrtchacks-adapter)Star history chart for your README
[](https://hysenlabs.com/projects/webrtchacks-adapter)Was this useful?