code: func newClient(c clientConfig) (client, error) {
  	if c.app.tokenURL == "" {
  		c.app.tokenURL = tokenURL
  	}
  
  	if c.app.unauthenticated() {
  		return &baseClient{clientWithAgent(c.agent)}, nil
  	}
  
  	if err := c.app.validateAuth(); err != nil {
  		return nil, err
  	}
  
  	return newAppClient(c)
  }
docs: // newClient returns a new client using the given user to make requests.