SA can be used with any ranged or finesse weapon. What is a ranged weapon? Any weapon that that has a range. So if a weapon has a range expressed (range XX/YY) it can be used to sneak attack.
It's Crawford's way or the highway, No Melee Ranged Sneak Attack, It's Crawford's way or the highway
A dagger is a melee weapon. It has the Thrown property, which allows you to "throw the weapon to make a ranged attack. (p 147). Note that this doesn't transform it from a melee weapon into a ranged weapon.
It's still a melee weapon. Refer to the chart on page 149. It has all the information you need.
Here's the problem. The rules are written in English. When someone says "that guy attacked me with a ranged weapon" and you weren't playing D&D, you'd think that would include anything at all that could be thrown, launched or shot at you. So, when you read a book that says "when you attack with a ranged weapon", you'd likely think that likewise includes anything that was not used in melee. The book is still vague enough to rule either way. After all, how does one make a ranged attack with a melee weapon if a melee weapon can only attack things within 5 feet of you, like the rules say. That's an impossibility. It has to, at least temporarily, become a ranged weapon for the duration of the attack since the rules say only ranged weapons can attack at a range further than 5 feet(and thrown weapons let you make a ranged attack with the weapon. But once again, if a weapon is used at range, it is logically a ranged weapon).Sorry guys but if we're going by the book the thrown property does not a ranged weapon make.
By that same logic, if you use a bow to bludgeon someone over the head, RAW you may in fact deal sneak attack damage -- the bow does not stop being a ranged weapon just because you use it to make an improvised melee attack.
The Improvised Weapon rules state "If a character uses a ranged weapon to make a melee attack, or throws a melee weapon that does not have the thrown property, it also does 1d4 damage." So, it is clearly stated that I can use a ranged weapon to make a melee attack. The quoted logic dictates that a weapon does not change its melee/ranged classification based on how it is used, so a melee attack using a bow is an attack using a ranged weapon. The sneak attack rules state "The attack must use a finesse weapon or a ranged weapon", and therefore RAW such an attack would qualify for sneak attack damage. QED.
The creators of 5e, including Crawford, explicitly state the rules are guidelines and the DM can modify as necessary.

(Dungeons & Dragons)
Rulebook featuring "high magic" options, including a host of new spells.