### Installing Dependencies - npm/Bash Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Installs the project's required Node.js dependencies listed in the package.json file using npm. This command must be executed within the cloned repository directory. ```bash $ npm install ``` -------------------------------- ### Installing Dependencies (Yarn) - Yarn/Bash Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Installs the project's required Node.js dependencies using Yarn as an alternative package manager to npm. This command serves the same purpose as 'npm install'. ```bash $ yarn install ``` -------------------------------- ### Running the Application - Node.js/Bash Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Starts the Node.js application server by executing the 'app.js' file. This command launches the Messenger bot application locally, typically listening on port 3000. ```bash node app.js ``` -------------------------------- ### Cloning the Repository - Git/Bash Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Clones the sample Messenger bot repository from GitHub to your local machine and navigates into the project directory. This is the initial step to obtain the source code. ```bash $ git clone https://github.com/fbsamples/fblogin-sample.git $ cd fblogin-sample ``` -------------------------------- ### Starting ngrok Tunnel - ngrok/Bash Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Starts an ngrok HTTP tunnel, forwarding requests from a public HTTPS URL to your local server running on port 3000. This command provides the external URL required for webhook configuration. ```bash ngrok http 3000 ``` -------------------------------- ### Installing ngrok Globally - npm/Bash Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Installs the ngrok tunneling service globally using npm. ngrok is necessary to expose your local development server to the internet, allowing Facebook to send webhook events to it. ```bash npm install -g ngrok ``` -------------------------------- ### Creating Heroku App via CLI (Bash) Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Creates a new Heroku application from the command line interface. The output shows the generated app name and URLs. ```Bash heroku apps:create ``` -------------------------------- ### Copying Environment File - Bash Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Copies the sample environment configuration file '.sample.env' to '.env'. The '.env' file is used to store sensitive application settings like API keys and tokens. ```bash cp .sample.env .env ``` -------------------------------- ### Deploying Code to Heroku (Bash) Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Deploys the current state of the master branch of the local Git repository to the linked Heroku application. ```Bash git push heroku master ``` -------------------------------- ### Calling Heroku App Profile Endpoint (URL) Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Example URL to call the /profile endpoint on the deployed Heroku application to configure webhook subscriptions and set the Messenger profile. Replace placeholders with your app name and verify token. ```URL http://.herokuapp.com/profile?mode=all&verify_token= ``` -------------------------------- ### Viewing Heroku App Logs (Bash) Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Streams the real-time log output from the Heroku application to the console, useful for debugging. ```Bash heroku logs --tail ``` -------------------------------- ### Configuring Webhook and Profile - URL/Endpoint Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Accesses the '/profile' endpoint of the local application to configure the Messenger webhook subscription and set Messenger profile settings. Replace 'verify-tokenl' with the actual VERIFY_TOKEN from your .env file. ```URL http://localhost:3000/profile?mode=all&verify_token=verify-tokenl ``` -------------------------------- ### Setting Heroku Config Variable via CLI (Bash) Source: https://github.com/fbsamples/fblogin-sample/blob/main/loginconnect_directintegrator/README.md Sets an environment variable (config var) for the Heroku application using the command line. Replace PAGE_ID=XXXX with the desired variable name and value. ```Bash heroku config:set PAGE_ID=XXXX ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.