downthecrop / supabase-ping

Ping a supabase instance once every 24h so your instance is never considered "inactive"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Supabase Ping

Node.js application to ping/pulse a Supabase database and writes a random number to a public anonymous table. Useful to prevent your database from being marked to be paused to inactivity.

Setup Instructions

  1. Install Dependencies (Requires Node 16.0+)

    npm install
  2. Environment Variables

    Create a .env file with the following content:

    SUPABASE_URL=your_supabase_url
    SUPABASE_ANON_KEY=your_supabase_anon_key

    Replace your_supabase_url and your_supabase_anon_key with your actual Supabase credentials.

  3. Run the Application

    node index.js

Scheduling with Cron

To schedule this script as a cron job:

  1. Open your crontab config:

    crontab -e
  2. Add a cron job to run the script at your desired frequency. For example, to run it every day at midnight:

    0 0 * * * /usr/bin/node /path/to/your/supabase-ping/index.js
    

    Make sure to replace /path/to/your/supabase-ping with the actual path to your project.

About

Ping a supabase instance once every 24h so your instance is never considered "inactive"


Languages

Language:JavaScript 100.0%