Public | Automated Build

Last pushed: 3 months ago
Short Description
Sends a text message when you near your Spark NZ voice allowance.
Full Description

Spark Voice Usage Alert

What is this?

I found that on Spark NZ (cell phone provider), a post paid monthly plan wouldn't stop incuring additional charges when I run out of minutes and it wouldn't notify me if I did use too many minutes!

After a painful bill, I made this to prevent it happening again.


  • Logs into the Spark website with your mobile account details.
  • Determines how many minutes of your allowance has been used.
  • At 80%, 90%, 100% and 110% usage this sends a text message to warn you (via Plivo).


  • A Redis server. This is used to keep track of the last alert sent so you don't get repeated alerts.
  • A Plivo account with credit. This is used to send you a text.
  • NodeJS installed on your server.

Environment Variables


This is the email address you use to login with MySpark.


This is your Spark password you use to login with MySpark.


This is the Spark mobile number to check. This number is mentioned in the alert text message.


This is the hostname for your Redis server to store details about the last check (to prevent repeated alerts).


This is your Plivo auth ID. You can get this by signing up at


This is your Plivo auth token. You can get this by signing up at


This is the number to send text messages to. This includes the country code, e.g.: 642XXXXXXXX.


The number to send the text from. Apparently this can be anything but I used 14154847489 which was used by the Plivo dashboard.


This is a URL to hit after the job completes successfully. Use this with something like to get notified if something breaks.

Setting it up

  1. Clone the repository.
  2. Run npm install to grab dependencies.
  3. Configure the environment variables with your options.
  4. Configure node start.js to run on a schedule with a CRON job.

Setting it up with Docker


Using Docker Compose is recommended. See docker-compose.yml for an example which includes Redis and cron-container-starter.


Use docker build -t jordancrawford/spark-voice-usage-alert .


This is not endorsed by Spark at all and these API end points are unofficial.

Docker Pull Command