In these documentation pages we provide dozens of example codes in a multitude of languages to get you started. These example codes are just that, examples.
Since this code has to apply to any project, the writers must assume a lot of things that may or may not be true for your unique development environment, installed libraries, or existing code. They use placeholder names for functions and variables that are best customized for your specific project. Some will require modifications to fully integrate into your project.
Also, these example codes may focus on one step of the process and still require some additional steps that for simplicity’s sake were not fully expanded on, such as saving the output into a local file or database after checking a key. Typically we will leave a comment in the code about what we expect to happen next.
Consider them a starting point, not ready to use code.