시작하기
이 플러그인의 설치 단계와 전체 마크다운 가이드를 포함한 설정 지시를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-env`
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/env/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.
설치
설치 제목bun add @capgo/capacitor-envbunx cap syncimport
import 제목import { Env } from '@capgo/capacitor-env';API 개요
API 개요getKey
__CAPGO_KEEP_0____CAPGO_KEEP_0__ 키를 통해 특정 환경 변수의 값을 가져옵니다.
이 메서드는 네이티브 빌드 프로세스 중에 설정된 환경 변수를 가져옵니다. 변수는 네이티브 프로젝트에서 구성되어야 런타임에 접근할 수 있습니다.
import { Env } from '@capgo/capacitor-env';
const result = await EnvPlugin.getKey({ key: 'API_URL' });console.log(result.value); // 'https://api.example.com'진실의 근원
진실의 근원이 페이지는 플러그인의 src/definitions.ts공개 API이 업스트림에서 변경될 때마다 다시 싱크를 실행하세요.