Securely storing auth keys and secrets on IOT clients

While deploying Raspberry Pi-clients for ERPNext at scale(I need 50 clients). What would be the best way to deliver, save and retrieve API Keys and Secrets.

I have a similar doubt for store WiFi-credentials.

Storing them in plain text with only root having the permission to read, seems like the only solution I could find. It does not seem right however.