ExpoLaunch
Supabase

Edge Function Setup

Supabase Edge Functions are server-side TypeScript functions running on Deno, deployed globally at the edge — closer to your users. They allow you to run backend logic securely, without managing traditional infrastructure.

ExpoLaunch includes a pre-configured edge function for user self-deletion. Follow this guide to deploy it to your Supabase project.


Project Structure

The edge function is already included inside the project:

supabase/
├── functions/
│   └── user-self-deletion/
│       └── index.ts
├── migrations/
│   └── *****_remote_schema.ts
└── config.toml

1. Install Supabase CLI

First, install the Supabase CLI globally:

npm install -g supabase

supabase --version

2. Deploy the Function

Navigate to the supabase/functions directory and deploy:

cd supabase/functions

supabase functions deploy user-self-deletion

supabase edge

3. Invoke the Function from App

The function is already integrated in the ExpoLaunch template:

import {supabase} from '@shared/config/supabase'

export async function deleteUser(): Promise<void> {
  const {error} = await supabase.functions.invoke('user-self-deletion')

  if (error) {
    console.log('Error deleting user:', error)
    throw new Error(`Error deleting user: ${error}`)
  } else {
    console.log('User account deleted')
  }
}

Common Use Cases

Supabase Edge Functions are great for:

  • Custom auth logic
  • Integrating 3rd party APIs
  • Data processing
  • Scheduled jobs

Deployment Strategy

Deploy safely:

# production
supabase functions deploy user-self-delete --project-ref your-production-project

Manage versions:

supabase functions deploy user-self-delete:v1