code: func New(opts ...ClientOption) (*Client, error) {
  	c := &Client{
  		haveCache: noHaveCache{},
  		Logger:    log.New(os.Stderr, "", log.Ldate|log.Ltime),
  		authMode:  auth.None{},
  	}
  	for _, v := range opts {
  		v.modifyClient(c)
  	}
  	if c.sto != nil && len(opts) > 1 {
  		return nil, errors.New("use of OptionUseStorageClient precludes use of any other options")
  	}
  
  	if inGopherJS {
  		c.noExtConfig = true
  		c.sameOrigin = true
  	}
  	if c.noExtConfig {
  		c.setDefaultHTTPClient()
  		return c, nil
  	}
  
  	if c.server != "" {
  		if !isURLOrHostPort(c.server) {
  			configOnce.Do(parseConfig)
  			serverConf, ok := config.Servers[c.server]
  			if !ok {
  				log.Fatalf("%q looks like a server alias, but no such alias found in config at %v", c.server, osutil.UserClientConfigPath())
  			}
  			c.server = serverConf.Server
  		}
  		c.setDefaultHTTPClient()
  		return c, nil
  	}
  
  	var err error
  	c.server, err = getServer()
  	if err != nil {
  		return nil, err
  	}
  	err = c.SetupAuth()
  	if err != nil {
  		return nil, err
  	}
  	c.setDefaultHTTPClient()
  	return c, nil
  }
docs: // New returns a new Perkeep Client.
  //
  // By default, with no options, it uses the client as configured in
  // the environment or default configuration files.