The specifics might depend on the exact gameplay behaviour you want to achieve but there are generally two options.
First you can consider adding everyone (both players and spectators) to the same match and using the match state to track who is actually a player. Spectators would not be allowed to send messages to the match, just receive data.
The second option is to add spectators to a separate stream (docs here) and have the match publish data updates to that stream. That way the spectators aren’t visible to the players in any way, but you could still use stream count as an indicator of number of spectators for example if you choose to make that visible to players.