Skip to content

Commit ed5b93a

Browse files
Christiaan LandmanChristiaan Landman
authored andcommitted
chore: further cleanup of .env files, documented how to use .env.local in todo app's readme
1 parent a878a28 commit ed5b93a

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

demos/react-native-supabase-group-chat/.env

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Copy this template: `cp .env.template .env`
2-
# Edit .env and enter your Supabase and PowerSync project details.
1+
# Replace the credentials below with you Supabase, PowerSync and Expo project details.
32
EXPO_PUBLIC_SUPABASE_URL=https://foo.supabase.co
43
EXPO_PUBLIC_SUPABASE_ANON_KEY=foo
54
EXPO_PUBLIC_POWERSYNC_URL=https://foo.powersync.journeyapps.com
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Edit and enter your Supabase and PowerSync project details.
1+
# Replace the credentials below with you Supabase, PowerSync and Expo project details.
22
EXPO_PUBLIC_SUPABASE_URL=https://foo.supabase.co
33
EXPO_PUBLIC_SUPABASE_ANON_KEY=foo
4-
EXPO_PUBLIC_SUPABASE_BUCKET= // Optional. Only required when syncing attachments and using Supabase Storage. See packages/powersync-attachments.
4+
EXPO_PUBLIC_SUPABASE_BUCKET= # Optional. Only required when syncing attachments and using Supabase Storage. See packages/powersync-attachments.
55
EXPO_PUBLIC_POWERSYNC_URL=https://foo.powersync.journeyapps.com
66
EXPO_PUBLIC_EAS_PROJECT_ID=foo # Optional. Only required when using EAS.

demos/react-native-supabase-todolist/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,16 @@ bucket_definitions:
3737
3838
## Configure The App
3939
Replace the necessary credentials in the [.env](./.env) file.
40+
Generally, the `.env` file is used for storing common environment variables shared across all instances of the application, while `.env.local` is for overriding or providing environment-specific configurations, particularly for local development.
41+
As `.env.local` is normally not checked into source control (this project has a git-ignore rule), you can copy `.env`, name it `.env.local`, and then configure as needed.
4042

43+
### EAS Build configuration
4144
Take note that you will need an Expo account if you want to use EAS for your builds, the Expo project ID should then also be configured in the environment file.
4245

46+
For secret/sensitive environment variables which shouldn't be checked into source control, you can configure them as EAS secrets. They can be added via either the Expo website or the EAS CLI, both are explained [here](https://docs.expo.dev/build-reference/variables/#using-secrets-in-environment-variables).
47+
48+
General information on defining environment variables with Expo can be found here [here](https://docs.expo.dev/build-reference/variables/#can-eas-build-use-env-files).
49+
4350
## Run the App
4451

4552
Install the dependencies, including the React Native SDK:

demos/react-native-supabase-todolist/app.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { type ExpoConfig } from "expo/config";
33
import { config as dotenvConfig} from 'dotenv'
44
import { resolve } from 'path'
55

6-
// EAS doesn't load values from `.env` by default when considering the `app.config.ts` file
6+
// EAS doesn't load values from `.env` by default when consider the `app.config`
77
dotenvConfig({
8-
path: resolve(__dirname, '.env') || resolve(__dirname, '.env.local')
8+
path: resolve(__dirname, '.env')
99
})
1010

1111
const projectId = process.env.EXPO_PUBLIC_EAS_PROJECT_ID;

0 commit comments

Comments
 (0)