internetarchive-ts - v0.1.0
    Preparing search index...

    Function getSession

    • Beta

      Returns a new IaSession object. The IaSession object is the main interface to the internetarchive library. It allows you to persist certain parameters across tasks.

      Parameters

      • Optionalconfig: IaAuthConfig

        A dictionary used to configure your session.

      • debug: boolean = false

        To be passed on to this session's method calls.

      Returns IaSession

      a new IaSession object

      import { getSession }  from 'internetarchive';
      config = {'s3': {'access': 'foo', 'secret': 'bar'}};
      s = getSession(config);
      s.accessKey;
      'foo'

      // From the session object, you can access all of the functionality of the internetarchive API
      item = s.getItem('nasa');
      item.download();
      // nasa: success
      s.getTasks({taskIds:[31643513]})[0].server