アサイコトにらうったプログルトース
このプラグインのインストール手順と完全なマークダウンガイドを含む設定プロンプトをコピーしてください。
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.
インストール
「インストール」というタイトルのセクションCapgo の AI-Assisted セットアップを使用してプラグインをインストールできます。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-env` plugin in my project.Manual セットアップを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の説明を参照してください。
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 の作業を計画する場合、 native capability を使用する場合、@capgo/capacitor-env native capability を使用する場合、@capgo/capacitor-env API の概要 API の実装詳細 __CAPGO_KEEP_0__ Introductionの実装詳細について API Keys API Keysの実装詳細について、 Devices Devicesの実装詳細について