taw-rn-supabase
Wire Supabase JS client into a React Native (Expo) taw-kit project: session persistence via AsyncStorage, magic-link OAuth callback via expo-linking deep…
от nghiahsgs★ 31 звезда на GitHub
Установить taw-rn-supabase в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
taw-rn-supabase
Bridge a React Native (Expo) app to a Supabase backend the way taw-kit's Next.js webapp does it — same project, same RLS policies, shared types — but with mobile-specific glue (AsyncStorage, deep links, no next/headers).
Language rule: Detect the user's input language. Reply 100% Vietnamese for VN users (Southern, friendly), English for EN. Default Vietnamese for ambiguous input. Code/CLI commands stay English.
When to invoke
- New Expo project that needs Supabase auth or DB access
- Porting an existing taw-kit web feature (chat, profile, orders, etc.) to mobile and needing the same Supabase backend
- Adding magic-link sign-in to a mobile app
- Adding Supabase Realtime subscriptions (e.g. live chat) to mobile
Stack assumptions
- Expo SDK 51+ (Expo Router, file-based routing)
- TypeScript
@supabase/supabase-jsv2.45+@react-native-async-storage/async-storagefor session persistenceexpo-linking+expo-web-browserfor OAuth/magic-link callbacks- NativeWind v5 (if styling needed — pair with
expo-tailwind-setupskill) - Already-running Supabase project (URL + anon key in env)
If user is missing any of the above, invoke expo-tailwind-setup or instruct them to run supabase-setup skill first to provision the backend.
Step 1 — Install dependencies
npx expo install @supabase/supabase-js @react-native-async-storage/async-storage expo-linking expo-web-browser
Why each:
@supabase/supabase-js— universal client (works in RN with adapter)@react-native-async-storage/async-storage— persists JWT session across app restartsexpo-linking— handlesmyapp://deep-link callbacks from Supabase auth emailsexpo-web-browser— opens magic-link / OAuth in in-app browser, returns to app via deep link
Step 2 — Configure app scheme (required for deep links)
Edit app.json (or app.config.ts):
{
"expo": {
"scheme": "tawkitapp",
"ios": { "bundleIdentifier": "com.tawkit.<project-slug>" },
"android": { "package": "com.tawkit.<projectslug>" }
}
}
Replace tawkitapp with the project's slug from .taw/intent.json. The scheme MUST be unique per app — collisions cause silent deep-link failures.
Step 3 — Create Supabase client (lib/supabase.ts)
import 'react-native-url-polyfill/auto'
import AsyncStorage from '@react-native-async-storage/async-storage'
import { createClient } from '@supabase/supabase-js'
const supabaseUrl = process.env.EXPO_PUBLIC_SUPABASE_URL!
const supabaseAnonKey = process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY!
export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
auth: {
storage: AsyncStorage,
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: false, // RN does NOT use URLs for callbacks — deep links instead
},
})
Then npx expo install react-native-url-polyfill (Supabase needs URL APIs missing in RN's Hermes runtime).
.env keys (note EXPO_PUBLIC_* prefix — Expo equivalent of NEXT_PUBLIC_*):
EXPO_PUBLIC_SUPABASE_URL=https://<ref>.supabase.co
EXPO_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOi...
HARD RULE: NEVER add SUPABASE_SERVICE_ROLE_KEY to a mobile app. Mobile bundles ship to user devices = anyone can extract. Service-role calls go through your Next.js backend, which the mobile app calls via authenticated API.
Step 4 — Magic-link sign-in screen
app/(auth)/sign-in.tsx:
import { useState } from 'react'
import { View, Text, TextInput, Pressable, Alert } from 'react-native'
import * as Linking from 'expo-linking'
import { supabase } from '@/lib/supabase'
export default function SignIn() {
const [email, setEmail] = useState('')
const [loading, setLoading] = useState(false)
const sendMagicLink = async () => {
setLoading(true)
const redirectTo = Linking.createURL('/auth/callback')
const { error } = await supabase.auth.signInWithOtp({
email,
options: { emailRedirectTo: redirectTo },
})
setLoading(false)
if (error) Alert.alert('Lỗi', error.message)
else Alert.alert('Đã gửi', 'Mở email để bấm vào link đăng nhập.')
}
return (
<View className="flex-1 justify-center px-6 bg-white dark:bg-black">
<Text className="text-2xl font-bold mb-4 text-black dark:text-white">Đăng nhập</Text>
<TextInput
className="border border-gray-300 dark:border-gray-700 rounded-lg p-3 mb-4 text-black dark:text-white"
placeholder="[email protected]"
autoCapitalize="none"
autoComplete="email"
keyboardType="email-address"
value={email}
onChangeText={setEmail}
/>
<Pressable
className="bg-blue-600 rounded-lg p-3 items-center"
onPress={sendMagicLink}
disabled={loading || !email}
>
<Text className="text-white font-semibold">
{loading ? 'Đang gửi...' : 'Gửi link đăng nhập'}
</Text>
</Pressable>
</View>
)
}
(VN labels by default; switc
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
Read - 02
Write - 03
Edit - 04
Bash - 05
Grep - 06
Glob - 07
Skill
FAQ
Что делает скилл taw-rn-supabase?
Wire Supabase JS client into a React Native (Expo) taw-kit project: session persistence via AsyncStorage, magic-link OAuth callback via expo-linking deep links, Realtime subscriptions on RN, and shared TypeScript types with the Next.js webapp twin (taw-kit's typical web<->mobile pair pattern). This is the mobile counterpart of `auth-magic-link` (web). User-visible strings match the user's input language (Vietnamese by default for VN users). Trigger phrases (EN + VN): "supabase react native", "supabase mobile", "auth mobile expo", "magic link mobile", "tich hop supabase vao app", "supabase deep link".
Как установить скилл taw-rn-supabase?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл taw-rn-supabase запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…