You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-6Lines changed: 38 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,34 +8,66 @@ _Note: This API is available only to LinkedIn users registered in the European U
8
8
9
9
# Environment variables
10
10
11
-
TBD
11
+
Environment variables must be defined in the .env file. The full list of environment variables can be found in [environment.ts](./src/util/environment.ts). Below, we highlight the most important variables for running local tests:
12
+
13
+
-`LOCAL_LINKEDIN_API_TOKEN=YOUR_LINKEDIN_API_TOKEN`: Your LinkedIn user token for easily testing this Lambda locally.
14
+
-`LOGGER_CONSOLE=true`: Enables the logger in a human-friendly format instead of JSON format.
15
+
16
+
## How to retrieve a valid Linkedin token
17
+
18
+
-`LOCAL_LINKEDIN_CLIENT_ID` and `LOCAL_LINKEDIN_CLIENT_SECRET` must be configured properly (see next section). Then type:
19
+
20
+
```bash
21
+
yarn dev:token
22
+
```
23
+
24
+
And copy token value inside `LOCAL_LINKEDIN_CLIENT_SECRET` environment variable.
12
25
13
26
# How to develop
14
27
15
28
Follow these steps to set up the development environment and run essential tasks for the project:
16
29
30
+
- Install all dependencies using `nvm` and `yarn`:
31
+
32
+
```bash
33
+
nvm use
34
+
yarn install
35
+
```
36
+
17
37
- If you're part of Manfred's staff, download the necessary environment variables using [Doppler](https://www.doppler.com/):
18
38
19
39
```bash
20
-
npm run dev:secrets
40
+
yarn dev:secrets
21
41
```
22
42
23
-
- Run the application locally with a fake sqs event. This uses the `LOCAL_PROFILE_API_TOKEN` environment variable to retrieve the LinkedIn profile:
43
+
- Run the application locally with a fake sqs event. This uses the `LOCAL_PROFILE_API_TOKEN` environment variable to retrieve the LinkedIn profile (by default dev Manfred user):
24
44
25
45
```bash
26
-
npm run dev
46
+
yarn dev
47
+
```
48
+
49
+
- If you need to get new API token:
50
+
51
+
```bash
52
+
yarn dev:token
27
53
```
28
54
29
55
- Automatically lint the code and apply fixes to linting and formatting errors:
30
56
31
57
```bash
32
-
npm run lint
58
+
yarn lint
33
59
```
34
60
35
61
- Execute the unit test suite to ensure that everything is working as expected:
36
62
37
63
```bash
38
-
npm run test
64
+
yarn test
65
+
```
66
+
67
+
- If you have `localstack` configured, you can send a real message to the queue, simulate its reception, and handle it with:
68
+
69
+
```bash
70
+
yarn dev:consumer
39
71
```
40
72
41
73
Make sure you have all necessary environment variables and dependencies set up before running the tasks.
0 commit comments