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

    Function buildXMetaUsdidHeader

    • Builds the x-meta-usdid HTTP header value.

      Wire form on 448 and later:

      <usdid_uuid>.<timestamp>.<base64url(SPKI_P256_pubkey)>.<base64url(DER_ECDSA_signature)>
      

      The signature is ECDSA-SHA256-DER over the ASCII string <usdid_uuid>.<timestamp>.<base64url(SPKI_P256_pubkey)> — i.e. the whole three-part prefix before the final . — signed with the same EC P-256 private key the device used for IGUSDIDRegistrationMutation, and a verifier with crypto.createVerify('SHA256').update(msg).verify({ key, dsaEncoding: 'der' }, sig) checks it.

      Older 429-class builds embedded no public key: their three-part form is <uuid>.<ts>.<sig> with the signature over <uuid>.<ts>. 448 and later add the SPKI segment and fold it into the signed input.

      The timestamp is always JWS.exp - 2 — i.e. iat + 3598 when the standard 3600s TTL is used. The header therefore expires ~2s before the registration JWS.

      Parameters

      • input: { identity: UsdidIdentity; timestamp: number }
        • identity: UsdidIdentity
        • timestamp: number

          Unix seconds. Convention: iat + 3598 (= exp - 2).

      Returns string