sd_set_password("your_password")
Setting Your Password
Every surveydown survey requires a password, which is used to communicate with the Supabase database and access the admin page (should you choose to enable it).
You should first define your password on Supabase (see Store Data). Then open your R console to your project folder and set this password with sd_set_password()
.
Setting your project password
To set your surveydown password in a given project, run:
Do NOT put the sd_set_password()
function in your app.R
file!
This is designed to be run once in your R console and not again (unless you want to change the password).
What does this do?
By running sd_set_password()
, the following happens:
- A
.Renviron
file is created in your project directory that contains your password stored as an environment variable, e.g.,SUPABASE_PASSWORD=my_password
. - If there is a previously defined
SUPABASE_PASSWORD
in.Renviron
, it will be overwritten, so you are safe to run this function multiple times. - A
.gitignore
file is created in your project directory with.Renviron
in it so it won’t be accidentally pushed to GitHub. If a.gitignore
file already exists, it will be updated to include.Renviron
.
The .Renviron
file must remain in the root project directory - do not manually modify it
What is the password used for?
Your password is used for two purposes:
- Obtaining access to the Supabase database storing your survey data (see Store Data).
- Obtaining access to the admin page of your survey.
Be sure to use the same password when setting up your Supabase database.
Forgot your password?
To reveal your password, run:
sd_show_password()
This is a one-time operation, so you can also run in your R console. You will be prompted to confirm you really want to reveal your password, since it is a sensitive operation.