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-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 syncインポート
「インポート」セクションimport { Env } from '@capgo/capacitor-env';API オーバービュー
「API オーバービュー」セクションgetKey
キーを取得環境変数の特定のキーに対応する値を取得します。
このメソッドは、ネイティブ ビルド プロセス中に設定された環境変数を取得します。変数は、実行時にはネイティブ プロジェクトで構成する必要があります。
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 がアップストリームで変更された場合、再度同期を実行してください。
Getting Started から続けてください。
Getting Started から続けてください。あなたが「 Getting Started 」を使用してダッシュボードと API の操作を計画している場合、 「@capgo/capacitor-env」 for the native capability in Using @capgo/capacitor-env, 「@API/__CAPGO_KEEP_1__-env」 のネイティブ機能の実装詳細については「API Overview」 概要 概要の実装詳細について API キー API キーの実装詳細について デバイス デバイスの実装詳細について