Skip to content

Nyrrell/tgtg-notifier

Repository files navigation

icon Too Good To Go - Notifier

Too Good To Go - Notifier monitors your favorite TGTG Store for newly available items.
Supports multiple accounts and notifiers type (new type of notifiers will be added later).
I made it for my personal use only, but it may also be usefully to someone else.

Install

git clone https://github.com/Nyrrell/tgtg-notifier.git
cd tgtg-notifier
npm install
npm run build

Configure

Warning

Be cautious if you are already using Too Good To Go - Notifier.
The latest release has caused significant changes in configuration file.

To run this project, you will need to create a config.json file, see below or use example.config.json to set your configuration.

  • Set global parameters if needed timezone (default: UTC), locale (default: en-US)
  • To improve i18n, you can set available & price for translate in your language, it's totally optional.
  • For each account, be sure to fill these fields notifiers and email (optionally userId, accessToken and refreshToken if you already have it).
{
  "accounts": [
    {
      "email": "Too Good To Go email",
      "userId": "Too Good To Go User ID goes here if you have it",
      "accessToken": "Too Good To Go Access Token goes here if you have it",
      "refreshToken": "Too Good To Go Refresh Token goes here if you have it",
      "notifiers": [
        {
          "type": "discord",
          "webhookUrl": "https://discord.com/api/webhooks/123456789/ABCDEFG123456789"
        },
        {
          "type": "gotify",
          "apiUrl": "https://gotify.net",
          "token": "RFRNGDQmCgboyVF"
        }
      ]
    }
  ],
  "timezone": "Europe/Paris",
  "locale": "fr-FR",
  "language": {
    "available": "Disponible",
    "price": "Prix"
  },
  "testNotifiers": false
}

Available notifiers configuration

Tip

In global configuration you can set testNotifiers to true, the process will send test notifications with a fake item for all configured accounts then exit process.

DISCORD
  • type : string = discord
  • webhookUrl : string = https://discord.com/api/webhooks/123456789/ABCDEFG123456789
GOTIFY
  • type : string = gotify
  • apiUrl : string = https://gotify.net
  • token : string = RFRNGDQmCgboyVF
    • On the Gotify web UI, Apps > Create Application > reveal the token
  • priority? : number = 10
    • The priority level sent with the message (Default 5)
NTFY
  • type : string = ntfy
  • apiUrl : string = https://ntfy.sh
  • topic : string = tgtg
  • token? : string = tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2
  • priority? : number = 5
    • The priority level sent with the message, range 1 - 5 (Default 3)
SIGNAL-CLI-REST-API
  • type : string = signal
  • apiUrl : string = http://127.0.0.1:8080
  • number : string = +431212131491291
    • Registered Phone Number
  • recipients : array<string> = ["group.ckRzaEd4VmRzNnJaASAEsasa", "+4912812812121"]
    • Accept group-id and phone number

Tested with signal-cli-rest-api but python-signal-cli-rest-api will work too, project documentation say :
It is quite similar to bbernhard/signal-cli-rest-api, [...] i’m tempted to mimic bbernhard’s API routes as close as possible.

TELEGRAM
  • type : string = telegram
  • apiUrl? : string = https://api.telegram.org
    • Just in case url api is moved (optional)
  • token : string = 110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw
  • chatId : string | number = -100123456789
    • Unique identifier for the target chat or username of the target channel
  • messageThreadId? : number = 6
    • Unique identifier for the target message thread (topic) of the forum (optional)

Run

npm run start

If you don't set userId, accessToken and refreshToken You should receive an email from Too Good To Go.
You must validate the login by clicking the link inside this email within 2 minute (Do not use your phone if Too Good To Go app is installed).

After that tgtg-notifier start to monitor your favorite stores (once per minute) and send you a notification when a store's stock is add.

Notification example

DISCORD

notif

GOTIFY

notif

NTFY

notif

SIGNAL-CLI-REST-API

notif

TELEGRAM

notif