Set PlayerPrefs Before build

Is there a way to use PlayerPrefs.SetString before build and then PlayerPrefs.GetString in game ?
If not what are the alternatives ?

not sure that i understand what you mean by “before build”, but when you do the GetString you can pass default parameters if the key doesn’t exist.

other than that, you can check in your initialization code whether the key exists or not, and handle accordingly.

don’t forget to save at some point too.