Skip to main content
Back to plugins
@capgo/capacitor-env
Tutorial
@capgo/capacitor-env

Env

Securely manage environment variables and configuration across different build environments

Guide

Tutorial on Env

Using @capgo/capacitor-env

Capacitor plugin for accessing environment variables in native code.

Install

bun add @capgo/capacitor-env
bunx cap sync

What This Plugin Exposes

  • getKey - Retrieves the value of a specific environment variable by key.

Example Usage

getKey

Retrieves the value of a specific environment variable by key.

import { Env } from '@capgo/capacitor-env';

const result = await EnvPlugin.getKey({ key: 'API_URL' });
console.log(result.value); // 'https://api.example.com'

Full Reference

Keep going from Using @capgo/capacitor-env

If you are using Using @capgo/capacitor-env to plan native plugin work, connect it with @capgo/capacitor-env for the implementation detail in @capgo/capacitor-env, Getting Started for the implementation detail in Getting Started, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins.