Is there a way to programmatically see if a user is online?

Yes, we have a REST API call for that: talkjs.com/docs/REST_API/Reference/User_Presence.html.