Offbeat Iot
Get started
Reuse credentials across devices

Reuse credentials across devices

If you are programming in arduino (or other c++ microcontrollers, I guess)

File with wifi credentials

Create this file in your library folder alongside your other libraries downloaded by arduino

library/credentials/wifiCredentials.h
#pragma once
const char* mySSID = "the name of your wifi network";
const char* myPASSWORD = "the password for your wifi network";

Create a new user in the user interface

User creation

and add its credentials to the file below

library/credentials/exampleCredentials.h
#pragma once
const char* offbeatIotUser= "the user you created in the browser";
const char* offbeatIotPassword= "the users password";

then, when importing the credentials file, the constants will be available in code

using user credentials in a separate header file
import exampleCredentials.h
....
webSocketClient.begin(host, 80, path);
webSocketClient.setExtraHeaders("Accept=application/json");
webSocketClient.setAuthorization(offbeatIotUser, offbeatIotPassword);
Integrate