Membuka Mulanya
Copy sebuah prompt pengaturan dengan langkah instalasi dan panduan markdown lengkap untuk plugin ini.
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.
Instalasi
Bagian berjudul “Instalasi”bun add @capgo/capacitor-envbunx cap syncimport { Env } from '@capgo/capacitor-env';API Ringkasan
Judul Bagian “API Overview”getKey
Judul Bagian “getKey”Mengambil nilai variabel lingkungan spesifik berdasarkan kunci.
Metode ini mengambil variabel lingkungan yang telah ditetapkan selama proses pembangunan native. Variabel-variabel tersebut harus dikonfigurasi di proyek native sebelum dapat diakses pada saat runtime.
import { Env } from '@capgo/capacitor-env';
const result = await EnvPlugin.getKey({ key: 'API_URL' });console.log(result.value); // 'https://api.example.com'Sumber Kebenaran
Judul Bagian “Sumber Kebenaran”Halaman ini dihasilkan dari plugin’s src/definitions.tsRe-run sinkronisasi ketika API publik berubah secara upstream.