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.
설치
설치 제목Capgo의 AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 스킬을 추가하려면 다음 명령어를 사용하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins다음 명령어를 사용하여 플러그인을 설치하고 플랫폼에 따라 다음 지침을 따르세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-supabase` plugin in my project.만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래의 플랫폼에 따라 지침을 따르세요:
npm install @capgo/capacitor-supabasenpx cap syncAndroid 최소 SDK
제목이 'Android 최소 SDK'인 섹션Android 구현은 Android 8.0 이상이 필요합니다. __CAPGO_KEEP_0__을 설정 minSdkVersion = 26 in android/variables.gradle.
클라이언트 초기화
제목이 '클라이언트 초기화'인 섹션import { CapacitorSupabase } from '@capgo/capacitor-supabase';
await CapacitorSupabase.initialize({ supabaseUrl: 'https://your-project.supabase.co', supabaseKey: 'your-anon-key',});로그인하고 JWT에 접근
제목이 '로그인하고 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));인증 변경을 감지하세요
인증 변경 감지하기const listener = await CapacitorSupabase.addListener('authStateChange', ({ event, session }) => { console.log('Auth event', event); console.log('Current JWT available', Boolean(session?.accessToken));});
await listener.remove();supabase-js와 네이티브 인증을 pair하세요
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);네이티브 데이터 헬퍼
네이티브 데이터 도우미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);권장 사용
권장 사용 방법- 클립보드에 복사
- 실시간, 저장소, Edge Functions 및 고급 쿼리 기능을 유지하세요.
@supabase/supabase-js. - native JWT을 JavaScript 클라이언트로 전달하여 Supabase의 나머지 표면 영역을 사용하세요.
Getting Started에서 계속하세요.
Getting Started에서 계속하기If you are using Getting Started Capgo 플러그인 디렉토리와 연결하세요. Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, __CAPGO_KEEP_1__ Capgo 플러그인 구현 세부 사항에 대한 정보는 Adding or Updating Plugins에서 찾을 수 있습니다. Ionic Enterprise 플러그인 대체 옵션 Capacitor Native Builds의 제품 워크플로에 대한 정보는 Ionic Enterprise Plugin Alternatives에서 찾을 수 있습니다. Capgo Native Builds의 제품 워크플로에 대한 정보 for the product workflow in Capgo Native Builds.