Skip to content

Instantly share code, notes, and snippets.

@tmaly1980
tmaly1980 / gist:b302127640d735c778060a2b996a6d4d
Created April 30, 2026 17:25
Authentication module for React Native with Supabase
import { useState, useEffect, useCallback, useMemo } from 'react';
import { Platform } from 'react-native';
import { Session, User, AuthError } from '@supabase/supabase-js';
import createContextHook from '@nkzw/create-context-hook';
import { supabase, clearAuthStorage } from '../lib/supabase';
import AsyncStorage from '@react-native-async-storage/async-storage';
import * as WebBrowser from 'expo-web-browser';
import * as AppleAuthentication from 'expo-apple-authentication';
import { registerForPushNotificationsAsync, removePushToken } from '../services/pushNotificationService';
@tmaly1980
tmaly1980 / gist:b850dcdbd2e59d10094cd66d0cd71492
Created April 30, 2026 17:23
Authentication module for service provider react native app using Supabase
import createContextHook from '@nkzw/create-context-hook';
import { supabase } from '@/lib/supabase';
import { Session, User, AuthError } from '@supabase/supabase-js';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { tempProfileStorage } from '@/lib/tempProfileStorage';
import { getCurrentAppConfig, getAppTypeFromMetadata } from '@/lib/authConfig';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { Platform } from 'react-native';
import { modalAlert } from '@/lib/alert';
import * as WebBrowser from 'expo-web-browser';