/bolt.new-ai-integrations

Bolt.new AI and Nexmo (Vonage API) integration: Step-by-Step Guide 2025

Learn how to seamlessly integrate Bolt.new AI with Nexmo (Vonage API). Follow our step-by-step guide to streamline messaging automation and boost communications.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to integrate Bolt.new AI with Nexmo (Vonage API)?

 

Setting Up Dependencies in Your Project

 

  • Create or open your existing package.json file in your Bolt.new AI project.
  • Add the nexmo dependency manually by inserting it into the "dependencies" section. Since Bolt.new AI doesn’t provide a terminal, you must edit this file directly. For example, update your package.json like this:
    
    {
      "name": "my-bolt-project",
      "version": "1.0.0",
      "dependencies": {
        "nexmo": "^2.9.2"
      },
      "scripts": {
        "start": "node dist/index.js"
      }
    }
        

 

Creating the Nexmo Integration File

 

  • Inside your project’s source folder (commonly named src), create a new file called nexmoIntegration.ts.
  • Insert the following TypeScript code into nexmoIntegration.ts. This code initializes the Nexmo client using API credentials from environment variables and provides a function to send an SMS:
    
    import Nexmo from 'nexmo';
    
    

    const nexmo = new Nexmo({
    apiKey: process.env.NEXMOAPIKEY as string,
    apiSecret: process.env.NEXMOAPISECRET as string,
    });

    export function sendSMS(from: string, to: string, text: string): void {
    nexmo.message.sendSms(from, to, text, (error, responseData) => {
    if (error) {
    console.error("Error occurred:", error);
    } else {
    const message = responseData.messages[0];
    if (message.status === "0") {
    console.log("Message sent successfully.");
    } else {
    console.error(Message failed with error: ${message['error-text']});
    }
    }
    });
    }



  • Make sure that your API keys are stored in environment variables. In Bolt.new AI, you typically set these in your project’s settings or secrets configuration with keys NEXMOAPIKEY and NEXMOAPISECRET.

 

Integrating Nexmo Functionality in Your Main Application

 

  • Open your main TypeScript file (for example, index.ts or app.ts) in the src folder.
  • Import the sendSMS function from nexmoIntegration.ts at the top of your file, and call it in the context of your application logic. For instance, you might add an endpoint that triggers an SMS send:
    
    import express from 'express';
    import { sendSMS } from './nexmoIntegration';
    
    

    const app = express();

    // Example endpoint to send an SMS
    app.get('/send-sms', (req, res) => {
    const from = 'YourApp';
    const to = 'RecipientPhoneNumber'; // Replace with a valid phone number
    const text = 'Hello from Bolt.new AI integrated with Nexmo!';

    sendSMS(from, to, text);
    res.send('SMS send initiated. Check your console for the response.');
    });

    // Start the server on the designated port
    const PORT = process.env.PORT || 3000;
    app.listen(PORT, () => {
    console.log(Server is running on port ${PORT});
    });



  • This code snippet sets up a basic Express server with an endpoint /send-sms that uses the Nexmo integration to send an SMS message.

 

Finalizing Environment Variables and Deployment

 

  • Go to your Bolt.new AI project settings and locate the area where environment variables or secrets are configured.
  • Add the following keys:
    • NEXMOAPIKEY: Your Nexmo API key
    • NEXMOAPISECRET: Your Nexmo API secret
  • Ensure that your main file (e.g., index.ts) and the Nexmo integration file are saved. Bolt.new AI will automatically compile your TypeScript files and deploy the application.
  • Click the Run or Deploy button in the Bolt.new AI interface to start your application.

 

By following these steps, you have manually added the nexmo dependency, created a dedicated integration file, and incorporated the SMS sending functionality into your Bolt.new AI project without using a terminal.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022