teleproto - v1.229.0
    Preparing search index...

    Class StoreSession

    Persistent session that stores auth keys and entity data on disk using node-localstorage.

    Creates a directory named after the session in the current working directory. Suitable for long-running server applications where session data must survive restarts.

    const session = new StoreSession("my_session");
    const client = new TelegramClient(session, apiId, apiHash, {});

    Hierarchy (View Summary)

    Index
    • get authKey(): AuthKey | undefined

      Returns an AuthKey instance associated with the saved data center, or undefined if a new one should be generated.

      Returns AuthKey | undefined

    • set authKey(value: AuthKey | undefined): void

      Returns an AuthKey instance associated with the saved data center, or undefined if a new one should be generated.

      Parameters

      • value: AuthKey | undefined

      Returns void

    • get port(): number

      Returns the port to which the library should connect to.

      Returns number

    • get serverAddress(): string

      Returns the server address where the library should connect to.

      Returns string

    • Parameters

      • id: string | BigInteger
      • hash: string | BigInteger
      • username: string
      • phone: string
      • name: string

      Returns (string | BigInteger)[]

    • Processes the input TLObject or list and saves whatever information is relevant (e.g., ID or access hash). May be asynchronous; the library awaits the result where possible, and a storage failure never fails the request that produced it.

      Parameters

      • tlo: any

      Returns void

    • Sets the information of the data center address and port that the library should connect to, as well as the data center ID, which is currently unused.

      Parameters

      • dcId: number

        {number}

      • serverAddress: string

        {string}

      • port: number

        {number}

      Returns void