Skip to content

Commit 05cc36c

Browse files
docs: Update env variables example
Signed-off-by: Patrik Braborec <[email protected]>
1 parent f2aafda commit 05cc36c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sources/platform/actors/development/programming_interface/environment_variables.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Actor owners can define custom environment variables in `.actor/actor.json`. All
9494
"version": "0.1",
9595
"buildTag": "latest",
9696
"environmentVariables": {
97-
"api_token": "token_123",
97+
"MYSQL_USER": "my_username",
9898
}
9999
}
100100
```
@@ -132,11 +132,11 @@ import { Actor } from 'apify';
132132

133133
await Actor.init();
134134

135-
// get api_token
136-
const api_token = process.env.api_token
135+
// get MYSQL_USER
136+
const mysql_user = process.env.MYSQL_USER
137137

138-
// print api_token to console
139-
console.log(api_token);
138+
// print MYSQL_USER to console
139+
console.log(mysql_user);
140140

141141
await Actor.exit();
142142
```
@@ -148,17 +148,17 @@ In Python, use the `os.environ` dictionary:
148148

149149
```python
150150
import os
151-
print(os.environ['api_token'])
151+
print(os.environ['MYSQL_USER'])
152152

153153
from apify import Actor
154154

155155
async def main():
156156
async with Actor:
157-
# get api_token
158-
userId = os.environ['api_token']
157+
# get MYSQL_USER
158+
mysql_user = os.environ['MYSQL_USER']
159159

160-
# print api_token to console
161-
print(userId)
160+
# print MYSQL_USER to console
161+
print(mysql_user)
162162
```
163163

164164
</TabItem>

0 commit comments

Comments
 (0)