URL Search Parameters

The following URL Parameter is available to use in your EdgeWorker code bundles.


Assists in query string parsing. The URLSearchParams() constructor creates and returns a new URLSearchParams object. Documentation can be found here.
import URLSearchParams from 'url-search-params';  
export function onClientRequest(request) {
  var params = new URLSearchParams(request.query);
  if (params.get('key1')) {
    request.respondWith(200, {}, '');
  } else {
    request.respondWith(418, {}, '');