Skip to main content
Back to plugins
@capgo/capacitor-env
Tutorial
by github.com/Cap-go

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