Automatically create a new item when a line is added to a Google Sheet?

Hi, I see this has been asked before, for example, here: Building a Google Sheets Integration

However, the code example there doesn’t seem to be functional anymore. There’s no definition for the variable “key” which is a pretty major issue, and even after making adjustments to get around that, I was unable to get anything but a different code error about undefined ranges.

Is this still possible, and if so, is there a functional code example from more recently?