Cloud function to import customers from different sources

Downloads in past


2.1254.07 months agoa year agoMinified + gzip package size for import-customers in KB


Customers Import



  1. Install node dependencies

yarn lerna bootstrap

  1. Authenticate with Google Default Credential

gcloud auth application-default login

Your user will be used to deploy the serverless stack, you must have at least the following roles on the targeted project:
  • Deployment Manager Editor
  • Storage Admin
  • Logging Admin
  • Cloud Functions Developer

  1. copy .env.template
  2. replace variables from vault dev/import-customers
Development workflow
In your local machine, functions are run individually in tests. They are never run in a local stack.

Launching the web server of one function

There are two http function:
  • handleLoadCustomers
  • handleImportCustomers

To launch a web server and interact with one of this function, just do:
$ yarn start:handleLoadCustomers
# Or to watch
$ yarn watch:handleLoadCustomers


$ yarn start:handleImportCustomers
# Or to watch
$ yarn watch:handleImportCustomers

Then you can interract with them.


You can use curl:
$ curl localhost:8080/?executionDate=2022-02-04

The execution date should be the same day for Badge files and the next day for RH files.

Next steps

Handle http events with sls invoke local in serverless-google-cloudfunctions to stop using Function Framework