Connecting DayBack to Supabase


Point DayBack at your Supabase table(s) by following the steps here in order.

Once you map the required fields in step 5, you'll be able to see your schedule in DayBack. You can then return here to polish your setup and add the icons and buttons that will let you understand your schedule at a glance.

Turn on the Supabase Source

Navigate to admin settings and turn on Supabase in the list of "Calendar Sources." You'll see a button to authorize your connection by signing into Supabase.


Authorize

Click "Authorize" and sign into your Supabase account.

  • Email and Password: This can be any user your Supabase instance but should have access to the tables you'd like to see in your calendar.  This is not the username and password for your project as a whole: this is a user's credentials. If you're just getting started with Supabase...
    • If you haven’t created a project yet, click “New Project” otherwise navigate to your project.
    • In the sidebar click “Authentication.”
    • You will want to add a user if you don’t have one already so click “Users” and then “Add User.”
    • This will be the user you will use to authorize DayBack to access your Supabase data. So this can be a user specific to DayBack or an existing user that you already use.
  • Project URL: This is your project URL and can be seen on the "Project Overview" screen in Supabase just below your project name. Make sure you navigate to "Project Settings" then "Data API" to confirm that "Enable Data API" is set to "on." You can see your project URL there also, but we don't want the "/rest/v1/" part of the URL.
  • Publishable Key: You'll likely want to make a key specific to DayBack so that you can revoke or rotate it without affecting other services. In the sidebar click the cog icon for “Project Settings," then click “Api Keys." Then click “New publishable key” to create a new API key. Give it a label like “DayBack."

Create a New Calendar

This is where you'll define the basic setup of your first calendar. You'll likely have multiple calendars in your project—one for appointments, another for PTO requests and holiday, and maybe one for your resource's availability. Any table in your project that has date fields in it can be manipulated in DayBack as a calendar. You'll complete this and the following steps for each one.

If you don't yet have a table of events or appointments, or would like to add a new one to your Supabase project, DayBack makes this very easy. You can create a new table here: Adding DayBack's ideal appointments table to your Supabase project.

In this example, we're going to assume your table contains appointments and that your resources are people (team members and likely users or your app).


Calendar Settings

Select the "New Supabase Calendar" if one has been created for you, or click "Add New Calendar" in the second column from the left. Give your calendar a name: this is the name your users will see, it's not the name of your table: that comes next.

  • Table Name: The table you want to get records from. This is the table name without the schema: so it's "Events" not "public.Events."
  • Background color: Have fun here, though we find a slight transparency works best (a 0.85 alpha value). This will be the default color for records that don't match one of your status colors.
  • Read-Only: DayBack will respect your Row Level Security policies from Supabase, but this switch gives you a quick way to make it visually evident to your users that these records can't be edited (they'll see a little lock icon, drag will be disabled, etc.). When you get into field mapping (below), you can make field-by-field decision decisions as to which fields are editable.
  • Allow Unscheduled Events: Check out the unscheduled list in DayBack and turn this switch on if you'd like to drag these records to or from the unscheduled sidebar to the right of the calendar.
  • Show as Unavailable: If you want this calendar to depict the times you are NOT available, read this: Availability Scheduling. Your records will show up without any title or description, just greying out the time slots they occupy.
  • For Analytics Only: Sometimes you need your charts in DayBack to take advantage of records that you don't need to see in the calendar.
  • For Map Only: Select this if your table represents locations instead of temporal events. For example, you'd select this option if this was a table of customer locations you wanted to see in DayBack's Map so you could determine if you had appointments near an existing customer. Appointments would be shown on the calendar AND the map. Customers would show on the "map only."
  • Database Date Format: TYYY-MM-DD is the default for Supabase. This is how dates are stored in your table, not how they are displayed. DayBack will pick up your language and region and format your dates to match, though you can tweak this: date formats, time formats.
  • Database Time Format: Similar to dates, this is how times are stored in your Supabase table, not how they are displayed. H:mm:ss is the default for Supabase.
  • Show as Resource: More common in Google and MS365 calendars, use this if every record from this table is for the same resource. Feel free to leave this blank.
  • Default Popover Drawer: The table you want to get records fro

Map Your Fields

Here you'll tell DayBack which fields should show up in the calendar and which date fields will be used to fetch your records.

The Field Mapping tab will list the fields available in DayBack and highlight any required fields you may need to add to your table. You can disable any fields you don't need or are unsure about. Fields without an "enabled" checkbox are required for the calendar to function - an event's start time, for example:

Click "More" beneath any field for notes, suggestions, and the "read-only" and "hidden" options.

When you're done mapping all of the fields you want to start with, click "Validate Field Mapping" at the bottom of the page to test your work. You'll see any fields where you may have mistyped a field name. (Note that DayBack cannot check that your field types are correct, but you'll see errors when creating or editing events in the calendar if you've entered the wrong type for a field.)

Note that field names in Supabase are case sensitive.

The Fields

dfdf