igpapi — Instagram private API Simulator for Node.js (API reference) 4.19.0
    Preparing search index...

    Interface MobileSessionState

    interface MobileSessionState {
        accounts: Readonly<Record<string, MobileAccountState>>;
        appStartPhase?: "cold";
        appStartTimeMs?: number;
        authorization?: string;
        bandwidth?: MobileBandwidthSample;
        challenge?: Record<string, unknown>;
        checkpoint?: Record<string, unknown>;
        clientSessionIdLifetime: number;
        dsUserId?: string;
        familyDeviceIdBound?: boolean;
        fbidV2?: string;
        igWWWClaim?: string;
        passwordEncryptionKeyId?: string;
        passwordEncryptionPubKey?: string;
        pigeonSessionIdLifetime: number;
        profileFollows?: Readonly<
            Record<
                string,
                { atMs: number; following: boolean; outgoingRequest: boolean },
            >,
        >;
        profileInfoFetches?: Readonly<
            Record<string, { atMs: number; userFbid?: string; username: string }>,
        >;
        rmdEvaluationStarted?: boolean;
        sessionStartPhase?: "starting";
        thumbnailCacheBustingValue: number;
        xMetaUsdid?: string;
        xMid?: string;
        zeroInterface?: boolean;
        zeroPhase?: MobileZeroPhase;
    }
    Index

    Properties

    accounts: Readonly<Record<string, MobileAccountState>>

    Each account's own facts, by account id (dsUserId).

    appStartPhase?: "cold"

    Set while the app is in its cold-start window; requests created in this window carry the app_start_tag analytics tag.

    appStartTimeMs?: number

    App process start clock in milliseconds, set when the cold-start window opens. Requests that report the app-start clock (x-ig-app-start-time, the 448 feed/reels_tray) read it from here.

    authorization?: string

    Bandwidth estimator state, accumulated from completed transfers. Absent until the first response; rendered through bandwidthHeaders.

    challenge?: Record<string, unknown>

    Response when challenge data was purposefully fetched from the checkpoint URL. Set by challenge.route().

    checkpoint?: Record<string, unknown>

    Response when a request got a checkpoint error (challenge_required). Set automatically by the error router.

    clientSessionIdLifetime: number

    Random lifetime in ms for clientSessionId rotation (20min–24h). Generated once per device.

    dsUserId?: string
    familyDeviceIdBound?: boolean

    Whether the app has bound the device family id to its FX/switcher session. Absent (false) while the switcher still probes with an empty family_device_id (FxIgXavSwitcherBadgingDataQuery); set by BindFamilyDeviceId at the switch point (the first two post-login probes send "", the later ones the device family id).

    fbidV2?: string

    The viewer's own Facebook-side id, named as the login answer names it (logged_in_user.fbid_v2, a number on the wire, kept as its decimal text). The viewer's own profile asks the school-partnership badge with it. Exactly two functions write it, both in this module: adoptLoginAnswer (every login path hands it the answer's logged_in_user; an answer with no id clears the previous account's) and adoptLaunchFbidV2 (the launch's IGSharedAccountsQuery answer, data.me.id, which every Android and iOS launch sends, so a stored session that never saw a login answer learns it at its next launch). Both give the same id (448: login@fresh 018, login-2fa-trusted 022, login-2fa-totp 030; 451: the launch's shared-accounts answer). Absent until one of them writes it; persisted with the session like dsUserId.

    igWWWClaim?: string
    passwordEncryptionKeyId?: string
    passwordEncryptionPubKey?: string
    pigeonSessionIdLifetime: number

    Random lifetime in ms for pigeonSessionId rotation (20min–24h). Generated once per device.

    profileFollows?: Readonly<
        Record<
            string,
            { atMs: number; following: boolean; outgoingRequest: boolean },
        >,
    >

    The relationship a profile visit's follow answer stated for a user, kept for the visit's exit: following and outgoingRequest are the answer's own friendship_status fields. Written by the follow's answer and pruned on write like profileInfoFetches (profile.info-cache.ts, the one writer). The relation is the account's and the app keeps it in the account's user-session response cache, which dies with the session, so adoptLoginAnswer resets it. Absent: no follow answered in the window. Carried by the snapshot.

    profileInfoFetches?: Readonly<
        Record<string, { atMs: number; userFbid?: string; username: string }>,
    >

    The users whose profile info the app fetched recently, by user id: when the user's info stream last answered and what it named (the username, and the Facebook id the school-partnership badge asks with). The app keeps the answer in its response cache, which belongs to the account's user session; the cache dies with that session, so adoptLoginAnswer resets it. A search tap on a user whose info is still cached sends no touch-down prefetch and the profile opens from the cached user (android-451/media-like-repost-comment, repost, reels-comment, direct-thread-theme against media-like, reels-like, direct-new-thread, users-search: the same account, the second visit within eight minutes opens from the cache, the visit fourteen minutes after the last does not). Written by the profile's visit after the info stream answers (profile.info-cache.ts, the one writer), which also drops the entries past the freshness window. Absent: nothing cached. Carried by the snapshot.

    rmdEvaluationStarted?: boolean

    Set once the process has started evaluating its routing map (StartRmdEvaluation, at the first routing-map fetch's start); every request reports the map from then on (rmdReportedOf). A process fact, not the map itself: the map is the install's (MobileDeviceState.rmd), and a process that starts with a stored session reports none until its own fetch (BeginStoredProcess clears this).

    sessionStartPhase?: "starting"

    Set while the app is running the jobs it launches at user-session creation (see RequestScope's session-start). Requests issued in this window omit the x-pigeon-session-id header: the 448 build carries it on the pre-login and late-session families but not on the post-login session-start burst (sequences 23–35), where it reappears from the request after the burst.

    thumbnailCacheBustingValue: number
    xMetaUsdid?: string

    Pre-computed x-meta-usdid HTTP header value, reused byte-identical on every request until the next USDID re-register. Filled by postUsdidRegistration after a successful mutation, so the registration request itself carries no header on a fresh install (only a value cached from an earlier accepted registration is ever sent). Not persisted across processes by default (the signature embeds a timestamp).

    xMid?: string
    zeroInterface?: boolean

    Set once the app has started its zero-rating campaign evaluation; the zero-http-network-interface header is reported from then on. A separate concept from MobileSessionState.rmdEvaluationStarted: the 448 build carries x-fb-rmd already on the Loom config request but the network interface only from the zero-campaign request that follows it (see StartZeroInterface).

    zeroPhase?: MobileZeroPhase

    Zero-rating phase of the session. Absent (older snapshots) means authenticated when authorization is set and logged-out otherwise; read it through zeroPhaseOf.