This application uses environment variables to manage sensitive API keys and secrets. This approach enhances security by keeping these values out of the source code repository.
The application requires the following environment variables:
STREAM_CHAT_API_KEY
: Your Stream Chat API keySTREAM_CHAT_API_SECRET
: Your Stream Chat API secret
- The repository includes a
.env.example
file with placeholder values - Create a
.env
file in the root of your project (same level aspubspec.yaml
) - Copy the content from
.env.example
to your new.env
file - Replace the placeholder values with your actual Stream Chat credentials
Example .env
file content:
STREAM_CHAT_API_KEY=your_actual_stream_chat_api_key
STREAM_CHAT_API_SECRET=your_actual_stream_chat_api_secret
- The
.env.example
file is included in the repository as a template - Your actual
.env
file should NEVER be committed to version control - The
.gitignore
file is configured to exclude.env
but include.env.example
- Both files must be listed in the
assets
section inpubspec.yaml
(already done) - After updating environment files, run
flutter clean
andflutter pub get
- Sign up or log in to Stream
- Create a new app or use an existing one
- Navigate to the app dashboard
- Find your API Key and API Secret in the app settings
- Copy these values to your
.env
file