Hi @alist,
You can use the Raspberry Pi CLI configuration to setup the WiFi over SSH.
Step 1: Accessing raspi-config.
Step 2: Navigate to System Options.
Step 3: Select Wi-Fi.
Step 4: Enter SSID and Password.
Step 5: Confirm & Reboot.
You can also find the information here https://www.raspberrypi.com/documentation/computers/configuration.html . please check and let me know. Thanks.