This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Ejemplo de Servidor Node.js para WhatsApp + Gemini | |
| const axios = require('axios'); | |
| const { GoogleGenAI } = require('@google/genai'); | |
| const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY }); | |
| // Endpoint para el Webhook de WhatsApp | |
| app.post('/webhook', async (req, res) => { | |
| const msg = req.body.entry[0].changes[0].value.messages[0]; | |
| const from = msg.from; // Teléfono del cliente |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Ejemplo de Servidor Node.js para WhatsApp + Gemini | |
| const axios = require('axios'); | |
| const { GoogleGenAI } = require('@google/genai'); | |
| const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY }); | |
| // Endpoint para el Webhook de WhatsApp | |
| app.post('/webhook', async (req, res) => { | |
| const msg = req.body.entry[0].changes[0].value.messages[0]; | |
| const from = msg.from; // Teléfono del cliente |