static fromApplicationOnlyAuth ({
    userAgent = isBrowser ? global.navigator.userAgent : requiredArg('userAgent'),
    clientId = requiredArg('clientId'),
    clientSecret,
    deviceId,
    grantType = snoowrap.grantType.INSTALLED_CLIENT,
    permanent = true,
    endpointDomain = 'reddit.com'
  }) {
    return this.prototype.credentialedClientRequest.call({
      clientId,
      clientSecret,
      // Use `this.prototype.rawRequest` function to allow for custom `rawRequest` method usage in subclasses.
      rawRequest: this.prototype.rawRequest
    }, {
      method: 'post',
      baseUrl: `https://www.${endpointDomain}/`,
      uri: 'api/v1/access_token',
      form: {grant_type: grantType, device_id: deviceId, duration: permanent ? 'permanent' : 'temporary'}
    }).then(response => {
      if (response.error) {
        throw new errors.RequestError(`API Error: ${response.error} - ${response.error_description}`);
      }
      // Use `new this` instead of `new snoowrap` to ensure that subclass instances can be returned
      const requester = new this({userAgent, clientId, clientSecret, ...response});
      requester.config({endpointDomain});
      return requester;
    });
  }
/**
  * @summary Creates a snoowrap requester from a "user-less" Authorization token
  * @desc In some cases, 3rd party app clients may wish to make API requests without a user context. App clients can request
  * a "user-less" Authorization token via either the standard client_credentials grant, or the reddit specific
  * extension to this grant, https://oauth.reddit.com/grants/installed_client. Which grant type an app uses depends on
  * the app-type and its use case.
  * @param {object} options
  * @param {string} options.userAgent A unique description of what your app does. This argument is not necessary when snoowrap
  is running in a browser.
  * @param {string} options.clientId The client ID of your app (assigned by reddit). If your code is running clientside in a
  * browser, using an "Installed" app type is recommended.
  * @param {string} [options.clientSecret] The client secret of your app. Only required for "client_credentials" grant type.
  * @param {string} [options.deviceId] A unique, per-device ID generated by your client. Only required
  * for "Installed" grant type, needs to be between 20-30 characters long. From the reddit docs: "reddit *may* choose to use
  * this ID to generate aggregate data about user counts. Clients that wish to remain anonymous should use the value
  * DO_NOT_TRACK_THIS_DEVICE."
  * @param {string} [options.grantType=snoowrap.grantType.INSTALLED_CLIENT] The type of "user-less"
  * token to use {@link snoowrap.grantType}
  * @param {boolean} [options.permanent=true] If `true`, the app will have indefinite access. If `false`,
  access will expire after 1 hour.
  * @param {string} [options.endpointDomain='reddit.com'] The endpoint domain that the returned requester should be configured
  to use. If the user is authenticating on reddit.com (as opposed to some other site with a reddit-like API), you can omit this
  value.
  * @returns {Promise<snoowrap>} A Promise that fulfills with a `snoowrap` instance
  * @example
  *
  * snoowrap.fromApplicationOnlyAuth({
  *   userAgent: 'My app',
  *   clientId: 'foobarbazquuux',
  *   deviceId: 'unique id between 20-30 chars',
  *   grantType: snoowrap.grantType.INSTALLED_CLIENT
  * }).then(r => {
  *   // Now we have a requester that can access reddit through a "user-less" Auth token
  *   return r.getHot().then(posts => {
  *     // do something with posts from the front page
  *   });
  * })
  *
  * snoowrap.fromApplicationOnlyAuth({
  *   userAgent: 'My app',
  *   clientId: 'foobarbazquuux',
  *   clientSecret: 'your web app secret',
  *   grantType: snoowrap.grantType.CLIENT_CREDENTIALS
  * }).then(r => {
  *   // Now we have a requester that can access reddit through a "user-less" Auth token
  *   return r.getHot().then(posts => {
  *     // do something with posts from the front page
  *   });
  * })
  */
@summary Creates a snoowrap requester from a "user-less" Authorization token
@desc In some cases, 3rd party app clients may wish to make API requests without a user context.




@summary Creates a snoowrap requester from a " user - less " Authorization token @desc In some cases 3rd party app clients may wish to make API requests without a user context .
static fromApplicationOnlyAuth ({
    userAgent = isBrowser ? global.navigator.userAgent : requiredArg('userAgent'),
    clientId = requiredArg('clientId'),
    clientSecret,
    deviceId,
    grantType = snoowrap.grantType.INSTALLED_CLIENT,
    permanent = true,
    endpointDomain = 'reddit.com'
  }) {
    return this.prototype.credentialedClientRequest.call({
      clientId,
      clientSecret,
      rawRequest: this.prototype.rawRequest
    }, {
      method: 'post',
      baseUrl: `https://www.${endpointDomain}/`,
      uri: 'api/v1/access_token',
      form: {grant_type: grantType, device_id: deviceId, duration: permanent ? 'permanent' : 'temporary'}
    }).then(response => {
      if (response.error) {
        throw new errors.RequestError(`API Error: ${response.error} - ${response.error_description}`);
      }
      const requester = new this({userAgent, clientId, clientSecret, ...response});
      requester.config({endpointDomain});
      return requester;
    });
  }
static fromApplicationOnlyAuth ( { userAgent = isBrowser ? global . navigator . userAgent : requiredArg ( 'userAgent' ) , clientId = requiredArg ( 'clientId' ) , clientSecret , deviceId , grantType = snoowrap . grantType . INSTALLED_CLIENT , permanent = true , endpointDomain = 'reddit.com' } ) { return this . prototype . credentialedClientRequest . call ( { clientId , clientSecret , rawRequest : this . prototype . rawRequest } , { method : 'post' , baseUrl : ` ${ endpointDomain } ` , uri : 'api/v1/access_token' , form : { grant_type : grantType , device_id : deviceId , duration : permanent ? 'permanent' : 'temporary' } } ) . then ( response => { if ( response . error ) { throw new errors . RequestError ( ` ${ response . error } ${ response . error_description } ` ) ; } const requester = new this ( { userAgent , clientId , clientSecret , ... response } ) ; requester . config ( { endpointDomain } ) ; return requester ; } ) ; }
@summary Creates a snoowrap requester from a "user-less" Authorization token
 @desc In some cases, 3rd party app clients may wish to make API requests without a user context.
@summary Creates a snoowrap requester from a " user - less " Authorization token @desc In some cases 3rd party app clients may wish to make API requests without a user context .
// Use `this.prototype.rawRequest` function to allow for custom `rawRequest` method usage in subclasses. // Use `new this` instead of `new snoowrap` to ensure that subclass instances can be returned