getstream env
Scope: app
Writes your app's API key into the env file your platform expects. For server-side platforms it also writes the API secret. The secret is never printed.
The target is detected from the project, or set with --target:
web .env STREAM_API_KEY, STREAM_API_SECRET
next .env.local NEXT_PUBLIC_STREAM_API_KEY, STREAM_API_SECRET
vite .env.local VITE_STREAM_API_KEY
expo .env EXPO_PUBLIC_STREAM_API_KEY
ios Secrets.xcconfig STREAM_API_KEY
android local.properties STREAM_API_KEY
flutter dart_defines.json STREAM_API_KEYThe env file is added to .gitignore.
Like every app-scoped command, env acts on the current project's
app unless --app-id or the STREAM_API_KEY and STREAM_API_SECRET
environment variables override it.
Existing key and secret lines are updated in place, so re-run the command after rotating keys.
getstream env [flags]Examples
getstream env
getstream env --target next
getstream env --target vite
getstream env --target iosFlags
| Flag | Description |
|---|---|
--app-id <int> |
id of the app to act on; defaults to the project's app |
--no-gitignore |
skip the .gitignore safety check |
-o, --out <string> |
write to this file instead of the target's default |
-t, --target <string> |
target platform: web, next, vite, expo, ios, android, flutter (default: autodetect) |
Global flags
| Flag | Description |
|---|---|
--verbose |
print API requests and full error details |