https://github.com/downthecrop/supabase-ping
Ping a supabase instance once every 24h so your instance is never considered "inactive"
https://github.com/downthecrop/supabase-ping
Last synced: 3 months ago
JSON representation
Ping a supabase instance once every 24h so your instance is never considered "inactive"
- Host: GitHub
- URL: https://github.com/downthecrop/supabase-ping
- Owner: downthecrop
- Created: 2023-12-27T06:29:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-01T03:55:47.000Z (over 1 year ago)
- Last Synced: 2025-01-23T11:48:00.570Z (4 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
2. **Install Dependencies (Requires Node 16.0+)**
```bash
npm install
```3. **Environment Variables**
Create a `.env` file with the following content:
```env
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.
4. **Run the Application**
```bash
node index.js
```## Scheduling with Cron
To schedule this script as a cron job:
1. Open your crontab config:
```bash
crontab -e
```2. Add a cron job to run the script at your desired frequency. For example, to run it every day at midnight:
```cron
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.