API Reference

Requesting a minified polyfill bundle

Get a bundle of polyfills which have been minified ready for production website use. This endpoint responds with a JavaScript file containing the polyfills which should be served to the requesting browser.

Request

Method GET
Path /v3/polyfill.min.js
Querystring
callback
Name of the JavaScript function to call after the polyfill bundle is loaded.
unknown
What to do for browsers which are not supported. Possible values are `ignore` and `polyfill`. Setting to `ignore` will return no polyfills to unsuported browsers. Setting to `polyfill` will return all requested polyfills to unsupported browsers.
flags
Configuration settings for every polyfill being requested. Possible values are `always` and `gated`. Setting `always` will return all requested polyfills to every browser. Setting `gated` will wrap every polyfill within a feature detection, only adding the polyfill if the feature was not detected. To enable both settings, separate them with a comma E.G. `always,gated`.
Headers
User-Agent
If no `ua` querystring value is configured, the User-Agent header's value will be used for polyfill targeting instead.
Accept-Encoding
If no `compression` querystring value is configured, the Accept-Encoding header's value will be used to decide if compression should be used on the polyfill

Example request:

Requesting the polyfill sets: ES5, ES6, and ES7. Wrapping each polyfill in a feature detect

https://polyfill.io/v3/polyfill.js?features=es5,es6,es7&flags=gated

Response

Status 200 on success
Headers
Content-Type
text/javascript;charset=UTF-8
Normalized-User-Agent
The User-Agent that was detected and was used for polyfill targeting.
Body The bundle of JavaScript polyfills.