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.
インストール
「インストール」のセクションCapgoのAIアシストセットアップを使用してプラグインをインストールできます。次のコマンドを使用して、CapgoスキルをAIツールに追加します。
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 Setupを使用する場合は、以下のコマンドを実行して、下記のプラットフォーム固有の手順に従ってください。
bun add @capgo/capacitor-envbunx cap syncImport
「Import」のセクションimport { Env } from '@capgo/capacitor-env';APIの概要
APIの概要getKey
__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の公開情報がアップストリームで変更された場合。
続けて始めましょう
続けて始めましょうこのプラグインを使用している場合 はじめに を計画するダッシュボードとAPI操作を接続する を使用する@capgo/capacitor-env のネイティブ機能のためにを使用する@capgo/capacitor-env API Overview の実装詳細のためにを使用するAPI Overview の概要 の実装詳細のためにを使用するIntroduction API Keys の実装詳細のためにを使用するAPI Keys、 の概要 の実装詳細のためにを使用するDevices