This Lambda function processes requests to import LinkedIn profiles. It uses LinkedIn's Member Data Portability (Member) API to retrieve relevant profile data and returns a CV in MAc format.
Note: This API is available only to LinkedIn users registered in the European Union.
Environment variables must be defined in the .env file. The full list of environment variables can be found in environment.ts. Below, we highlight the most important variables for running local tests:
LOCAL_LINKEDIN_API_TOKEN=YOUR_LINKEDIN_API_TOKEN: Your LinkedIn user token for easily testing this Lambda locally.LOGGER_CONSOLE=true: Enables the logger in a human-friendly format instead of JSON format.
LOCAL_LINKEDIN_CLIENT_IDandLOCAL_LINKEDIN_CLIENT_SECRETmust be configured properly (see next section). Then type:
yarn dev:tokenAnd copy token value inside LOCAL_LINKEDIN_CLIENT_SECRET environment variable.
Follow these steps to set up the development environment and run essential tasks for the project:
-
Install all dependencies using
nvmandyarn:nvm use yarn install
-
If you're part of Manfred's staff, download the necessary environment variables using Doppler:
yarn dev:secrets
-
Run the application locally with a fake sqs event. This uses the
LOCAL_PROFILE_API_TOKENenvironment variable to retrieve the LinkedIn profile (by default dev Manfred user):yarn dev
-
If you need to get new API token:
yarn dev:token
-
Automatically lint the code and apply fixes to linting and formatting errors:
yarn lint
-
Execute the unit test suite to ensure that everything is working as expected:
yarn test -
If you have
localstackconfigured, you can send a real message to the queue, simulate its reception, and handle it with:yarn dev:consumer
Make sure you have all necessary environment variables and dependencies set up before running the tasks.
