DocHub

Edge Functions

All 28 Supabase Edge Functions — purpose, auth, request/response, tables used, and external services

actions

Multi-purpose endpoint handling 6 different actions including course switching, discounts, referrals, sharing, and cohort management.

app-logs

Receives client logs, checks user existence, and forwards user reports to external webhook

calculate-checksum

Calculates MD5 checksums for files stored in R2 or database records

data-validation

Validates JSON data structures against schemas for admin tools

delete-account-data

Two-step account deletion with email confirmation followed by soft delete (status archived).

delete-unlinked-user

Cleans up orphaned auth users who exist in Auth but have no user_profile row.

generate-ai-token

Generates a short-lived JWT for AI voice chat sessions using a dedicated AI signing secret

generate-signed-url

Generates signed URLs for protected files in Supabase Storage or R2.

generate-token

General-purpose JWT token generation used internally by other flows.

get-ai-credits-products

Returns available AI credit products for purchase in the app

handshake

Primary sync endpoint that compares client JSON checksums against server manifests and returns content updates

handshake-dev

Dev/staging version of the handshake endpoint for testing sync changes before production.

manage-regen-requests

Manages regeneration requests for custom course audio

Overview

All 28 functions categorized, shared utilities, environment variables, external services

redirect-custom-course

Deep link redirect for custom course generation from email links

referral-code-user-signup

Attaches a referral code to a user profile after signup.

send-beta-invite

Sends beta testing invitation emails to selected users.

submit-custom-course

Multi-step endpoint for AI-generated custom course flow

submit-custom-course-dev

Dev/testing version of submit-custom-course for development workflows

track-status

Handles Google Play Real-Time Developer Notifications via Pub/Sub for subscription and purchase status changes

update-ai-usage

Deducts AI credits from a user account, consuming weekly allocation first then bank credits

update-cohorts

Updates cohort configurations and user assignments.

update-json

Regenerates shop.json manifests and updates custom course metadata

update-purchase-status

Admin endpoint that updates the status of course purchase and custom course purchase records

upstash-redis-cache

Manages caching via Upstash Redis for performance optimization.

validate-purchase

Validates course and subscription in-app purchases from Google Play and Apple App Store

validate-purchase-ai-credits

Validates AI credit purchases from Google Play and Apple App Store and adds credits to user balance

verify-gen-link

Verifies custom course generation link tokens for validity and expiration.

version-check

Compares client app version against latest server version and returns update availability