Getting Started
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 명령어를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-supabase`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/supabase/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
설치
설치npm install @capgo/capacitor-supabasenpx cap sync안드로이드 최소 SDK
SDK 제목: 안드로이드 최소 SDK안드로이드 구현은 Android 8.0 이상이 필요합니다. 설정 minSdkVersion = 26 in android/variables.gradle.
클라이언트 초기화
__CAPGO_KEEP_0__ 제목: 클라이언트 초기화import { CapacitorSupabase } from '@capgo/capacitor-supabase';
await CapacitorSupabase.initialize({ supabaseUrl: 'https://your-project.supabase.co', supabaseKey: 'your-anon-key',});로그인하고 JWT를 액세스하세요
__CAPGO_KEEP_0__ 제목: 로그인하고 JWT를 액세스하세요const { session, user } = await CapacitorSupabase.signInWithPassword({ email: 'user@example.com', password: 'password123',});
console.log('User', user?.id);console.log('JWT available', Boolean(session?.accessToken));인증 변경을 듣기
Section titled “인증 변경을 감지하기 위해”const listener = await CapacitorSupabase.addListener('authStateChange', ({ event, session }) => { console.log('Auth event', event); console.log('Current JWT available', Boolean(session?.accessToken));});
await listener.remove();Native Auth와 supabase-js Pair하기
Section titled “Native Auth와 supabase-js Pair하기”import { createClient } from '@supabase/supabase-js';
const { session } = await CapacitorSupabase.getSession();
const supabase = createClient('https://your-project.supabase.co', 'your-anon-key', { global: { headers: { Authorization: `Bearer ${session?.accessToken}`, }, },});
const { data } = await supabase.from('table').select('*');console.log(data);Native Database Helper
Section titled “Native Database Helper”const { data, error } = await CapacitorSupabase.select({ table: 'users', columns: 'id, name, email', filter: { active: true }, limit: 10, orderBy: 'created_at', ascending: false,});
console.log(data, error);권장 사용 방법
Section titled “권장 사용 방법”- 인증 및 세션 관리를 위해 이 플러그인을 사용하세요.
- __CAPGO_KEEP_0__
@supabase/supabase-js. - 자연스러운 JWT를 JavaScript 클라이언트로 전달하여 Supabase의 나머지 영역을 사용할 수 있습니다.
Getting Started에서 계속
Getting Started에서 계속하는 섹션Capgo를 사용 중이라면 Getting Started Capgo와 함께 native 플러그인 작업을 계획할 때, Capgo 플러그인 디렉토리 Capgo 플러그인 디렉토리에서 제품 워크플로우 Capacitor 플러그인들에 의해 Capgo Capacitor 플러그인들에 의해 Capgo의 implementation detail 플러그인 추가 또는 업데이트 플러그인 추가 또는 업데이트의 implementation detail Ionic Enterprise Plugin Alternatives Ionic Enterprise Plugin Alternatives 제품 워크플로우를 위한 대안 Capgo 네이티브 빌드 Capgo 네이티브 빌드 제품 워크플로우를 위한 대안