/clubspark-auto-bookings

AWS Lambda function in Node.js to book ClubSpark tennis courts

Primary LanguageJavaScript

Book a ClubSpark venue session through AWS Lambda

Book a ClubSpark venue session using a simple AWS Lambda function. The function makes the needed ClubSpark API calls to perform a full booking. Finally automate the execution using a trigger like Amazon EventrBridge (cron schedule).


Setup instructions

  1. Clone repository and run npm install
  2. ZIP contents of the folder (not the folder itself)
  3. Create an AWS Lambda function
    • Select 'Author from scratch', enter your function name and select Node.js 12.x.
    • Choose an existing role or create a new one and make sure it has the AWSLambdaBasicExecutionRole policy.
    • Upload the ZIP file.
    • Increase timeout from 3 sec to 2 min.
    • Set environment variables using the set-env npm command in package.json (see table below).
    • Configure a trigger. For instance, Amazon EventBridge, you can set up a cron schedule.

Environment variables

Variable Description
ACCOUNT_EMAIL Email for the account.
ACCOUNT_PASS Password for the account.
VENUE Venue where you want to book.