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.tspublic APIがアップストリームで変更されたら、再度Syncを実行してください。
Getting Startedから続けてください
Section titled “Getting Startedから続けてください”あなたが 環境設定の開始 ダッシュボードとAPIの作業を計画し、接続する 使用する@capgo/capacitor-env 使用する@capgo/capacitor-envのネイティブ機能 APIの概要 APIの概要の実装詳細 導入 導入の実装詳細 APIのキー APIのキーと実装詳細 デバイス デバイスの実装詳細