Dynamic Configure wifi ssid and pwd

I am thinking more from a perspective if i want to produce such products in scale and volumes. I will not be able to sell it as-is. Each and every device has to have the n/w credentials hard coded.

We will not be able to make it as a product, wherein you buy the programmed device and the user just plugs in and get started after setting their own wifi credentials.

I am sure this is a query which others may have faced and got around it.

Thoughts ?