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).
- Clone repository and run
npm install
- ZIP contents of the folder (not the folder itself)
- 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.
Variable | Description |
---|---|
ACCOUNT_EMAIL | Email for the account. |
ACCOUNT_PASS | Password for the account. |
VENUE | Venue where you want to book. |