How Bolt.new Powered Their Viral Referral Program with GrowSurf’s API

Posted by Kevin Yun | Last updated Apr 12, 2025

Background

Bolt.new website
Bolt.new

Bolt.new is a popular tool that allows anyone without a programming background to create and deploy full-stack web and mobile apps using AI. They were one of the original AI builders of 2024 and amassed a user base of millions of users in a matter of months. They are also one of the fastest growing startups in history, reaching $40M in annual recurring revenue in six months.

Bolt was looking to capitalize on their rocketship growth by launching a referral program. They wanted to reward their users for referring new users to their platform.

Bolt chose to use GrowSurf's referral software to power their referral program. Features that stood out to them were a flexible API, webhooks, and rate limits that could support their enormous and growing scale.

Referral program schema

Bolt.new wanted double-sided rewards for their referral program on two events.

  • If a user referred their friend, both users would get 200k in bonus referral tokens.
  • If the referral converted to a paid plan within 30 days, the referrer and referral would both get 5M tokens.

Free users could refer anyone for the 200k referral bonus, however the 5M referral token reward would only be available to paid users.

Referral landing

Technical overview

Here is an overview of what Bolt needed to implement to launch their referral program:

  • Create a GrowSurf campaign
  • Generate referral links for users
  • Track referral signups
  • Award referral signups
  • Track referral conversions
  • Award referral conversions

Bolt used the following developer tools from GrowSurf:

Create a GrowSurf campaign

Bolt first needed to create a campaign in the GrowSurf dashboard. They added a double-sided reward for both the referrer and the referred user. This represented the main 5M referral conversion event. The 200k token would be handled separately via webhooks later.

Double-sided reward
The Bolt.new referral program

Bolt also utilized reward metadata to add the values of paidTokenCount: 5000000 and freeTokenCount: 200000. These metadata values would be referenced later when automating rewards using webhooks and was useful because Bolt's marketing team could make changes anytime to reward values in the future without needing to get their engineering team involved.

Reward metadata

Generate referral links for users

The next thing Bolt needed to do was generate referral links for their users.

They added a new button to their dashboard that said "Get free tokens". It was highlighted in green to make it stand out.

Get free tokens button

When users would click on it, it would open up a popup with their unique referral link.

Referral link popup

Bolt generated the user's referral link by calling the /POST Add Participant endpoint.

They would pass in the user's email address and the referral link would be generated automatically. To take advantage of GrowSurf's anti-fraud system, they also passed in the user's IP address and fingerprint.

Here is an example of the API call:


      curl -X POST https://api.growsurf.com/v2/campaign/CAMPAIGN_ID/participant \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "email": "[email protected]",
        "ipAddress": "123.45.67.89",
        "fingerprint": "cfb163bd47ba666c52cb932c521e47f4"
      }'
  

Bolt does not collect user first names or last names, however if they did, they could pass those into the GrowSurf API call for further anti-fraud measures.

For users that had already generated referral links, they would call the /GET Participant by Email endpoint to display the referral link and referral stats.

Track referral signups

When someone landed on their friend's unique referral link, they would land on a URL that looked like https://bolt.new/?rid=abc123.

Bolt would then show a personalized popup upon landing that said "You've been referred by {{referrer-username}}" with details of the 200k referral signup bonus.

Referral landing

To ensure they were persisting the referrer cookie across different browser sessions and regardless of different webpages, GrowSurf provided them with the following JavaScript code:


        function getQueryParam(name) {
            const urlParams = new URLSearchParams(window.location.search);
            return urlParams.get(name);
        }

        function setCookie(name, value, days) {
            let expires = "";
            if (days) {
                const date = new Date();
                date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
                expires = "; expires=" + date.toUTCString();
            }
            document.cookie = `${name}=${value}; domain=.bolt.new; path=/;${expires}`;
        }

        const rid = getQueryParam("rid");
        if (rid) {
            setCookie("rid", rid, 365); // Store for 365 days
        }
    

Normally, GrowSurf's Universal Code (a snippet of code that can be added to any website) would be used to track referrals. However, Bolt wanted an API-only solution to ensure they could track referrals without adding any latency. The above JS code could be added to the bottom of their landing page without adding any additional load to their servers.

For tracking when the new referred user signed up, Bolt used the same GrowSurf API call as before, /POST Add Participant , to track referral signups. They would pass in the user's email address, as well as a referredBy parameter. They also passed in the optional parameters of IP address and fingerprint to ensure they would be able to get anti-fraud protection benefits.

This call would add the new user to the GrowSurf database and the referredBy parameter would be used to link the new user to the referrer.

Here is an example of the API call:


      curl -X POST https://api.growsurf.com/v2/campaign/CAMPAIGN_ID/participant \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -d '{
        "email": "[email protected]",
        "referredBy": "abc123",
        "ipAddress": "345.67.89.10",
        "fingerprint": "xyz7847x29bd26cb9326c521ec5f4148"
      }'
    

The referredBy parameter is the rid parameter from the referral link.

Award referral signups

Using GrowSurf's webhooks, Bolt was able to award both the referrer and the referred user 200k tokens for the referral signup.

They used the PARTICIPANT_REACHED_A_GOAL event, which included data of the new user, their referrer, and the campaign reward in each payload.

By utilizing reward metadata, Bolt was able to award the referrer and the referred user using the data.campaign.rewards[0].metadata.freeTokenCount value of 200000 tokens for the referral signup.

Track paid referral conversions

For the 5M referral token reward, Bolt needed to track when the referral converted to a paid user.

Whenever the referred user would convert into a paying customer, they would call the GrowSurf API endpoint /POST Trigger Referral by Participant Email .

Here is an example of the API call:


        curl -X POST https://api.growsurf.com/v2/campaign/CAMPAIGN_ID/participant/[email protected]/ref \
        -H "Authorization: Bearer YOUR_API_KEY"
    

In this example, the user [email protected] would be the referred user who converted to a paid user.

Award paid referral conversions

When Bolt would trigger the referral conversion, there would be a new reward unlocked for both parties.

Using GrowSurf's webhooks again, Bolt was able to award the referrer and referred friend the 5M tokens bonus for the referral conversion.

They used the PARTICIPANT_REACHED_A_GOAL webhook event, which would fire off twice -- one representing the 5M token reward for the referrer and one representing the 5M token reward for the referral.

Bolt utilized reward metadata again and referenced the data.campaign.rewards[0].metadata.paidTokenCount value of 5000000 tokens to automate the primary 5m token reward issuance.

Launch

Bolt took weeks to prepare for the launch of their referral program. They wanted to ensure that they had everything in place to launch smoothly.

Initial implementation took a few weeks, and they officially launched their referral program on Feb 6, 2024.

Referral program launch

Results

Bolt's referral program was a huge success. They were able to generate 1 billion tokens in the first 9 hours alone, representing tens of thousands of referrals.

9 billion tokens generated

Because Bolt used GrowSurf, they were able to scale their referral program to support their ever-growing user base. Bolt's engineers could move on to focus on their core product and other projects, while GrowSurf handled growth for them on autopilot.

Bolt's support team is also able to easily manage their referral program from the GrowSurf admin dashboard. When customer issues arise, the team can quickly identify and rectify any referral program-related problems.

Put your growth on autopilot

Launch a referral program for your B2C or B2B tech company and grow through the power of word-of-mouth