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).

Important

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:

sd_set_password("your_password")
Important

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:

  1. A .Renviron file is created in your project directory that contains your password stored as an environment variable, e.g., SUPABASE_PASSWORD=my_password.
  2. If there is a previously defined SUPABASE_PASSWORD in .Renviron, it will be overwritten, so you are safe to run this function multiple times.
  3. 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:

  1. Obtaining access to the Supabase database storing your survey data (see Store Data).
  2. Obtaining access to the admin page of your survey.
Important

Be sure to use the same password when setting up your Supabase database.

Forgot your password?

To reveal your password, run:

sd_show_password()
Important

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.

Back to top