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セットアップを使用する場合は、以下のコマンドを実行して、下記のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-envbunx cap syncImport
「Import」のセクションimport { Env } from '@capgo/capacitor-env';getKey
Section titled “キーを取得する”特定の環境変数の値をキーで取得します。
このメソッドは、ネイティブのビルドプロセス中に設定された環境変数を取得します。変数は、実行時にはネイティブプロジェクトで構成する必要があります。
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
Section titled “続けてGetting Started”あなたが はじめに を計画するダッシュボードとAPI操作を接続する を使用する@capgo/capacitor-env のネイティブ機能のためにを使用する@capgo/capacitor-env APIの概要 の実装詳細のためにAPIの概要 はじめに の実装詳細のためにはじめに APIのキー の実装詳細のためにAPIのキー デバイス の実装詳細のためにデバイス