/bubble-integrations

Bubble.io and Backblaze B2 integration: Step-by-Step Guide 2024

Check our guide to effortlessly integrate Bubble.io with Backblaze B2, and optimize your cloud storage management like a pro!

What is Backblaze B2?

Backblaze B2 is a cloud storage solution provided by Backblaze, a leading company in data storage and backup services. It's designed as a cost-effective tool for storing large volumes of data online. Providing both personal as well as business plans, Backblaze B2 allows for data backup, file sharing, and has the capability to host websites or applications. The service supports advanced features like file versioning, large file support, and it can preserve file revisions for up to 30 days.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web or mobile app? RapidDev builds Bubble apps with your growth in mind.

Book a free No-Code consultation

How to integrate Bubble.io with Backblaze B2?

Step 1: Create an account on Bubble and Backblaze B2

Before anything else, make sure you have accounts on both Bubble.io and Backblaze B2. In case you don't have one, go to their respective websites and create one.

For Bubble: https://bubble.io/
For Backblaze B2: https://www.backblaze.com/b2/cloud-storage.html

Step 2: Create a new app on Bubble

First, log in to your Bubble account and create a new app. Click on the "New App" button, provide a name for the app, and select a template if you want to. Once you're satisfied, click on "Create New App."

Step 3: Set up Bucket on Backblaze B2

Now, switch over to Backblaze B2. Once logged in, you need to create a new bucket which will be used for storing your files via Bubble. Click on the "Buckets" link on the left menu, then click the "Create a Bucket" button. Give your bucket a unique name, select the type of access you want for this bucket, and click "Create a Bucket."

Step 4: Generate API Key

After the bucket is created, you will need an API key to enable interaction between Bubble and Backblaze B2. For this, click on the "App Keys" menu on the left, then click "Add a New Application Key". Give a name to the key and grant necessary permissions. Once done, click on "Create New Key". Important: make sure to save this key in a secure place as Backblaze will not show you this key again for security reasons.

Step 5: Configure API Connector on Bubble

Now, you need to set up Bubble to use this key to interact with Backblaze B2. Go back to Bubble and open your app, then navigate to Plugins. Click on "Add plugins", search for "API Connector", and add it to your app.

Once the API Connector is added, you need to configure it. Click on "API Connector" in the Plugins tab. Click "Add another API", name it something like "Backblaze B2."

We will create two calls: one for file upload and one for listing the files.

Step 6: Configure 'Get Upload URL' Call

In the API you created, click "Add another call". Name this call "Get Upload URL". Use the following configuration:

Click Initialize Call, if everything is configured correctly, you should get a message saying that the call is set up.

Step 7: Configure 'Upload File' Call

Add another API call, name it "Upload File". This call will be used to upload the files to Backblaze B2. Use the following configuration:

  • Method: POST
  • Use as: Action
  • URL: Use Result from … 'Get Upload URL' uploadUrl
  • Body:
{
"file_data": "Base64 encode file",
"file_name": "Name of the File"
}
  • Headers key-value pairs should include:

  • Authorization: Use Result from … 'Get Upload URL' authorizationToken

  • X-Bz-File-Name: file_name

  • Content-Type: content_type of the file

  • X-Bz-Content-Sha1: do_not_verify

Here, 'Get Upload URL' should be your previous 'Get Upload URL' call. 'file_name' should be dynamically retrieved from the file to be uploaded. 'content_type' should be based on the file type to be uploaded.

Initialize the call, and it should be set as well.

Step 8: Set up Your Workflow

Now, depending on how you want to use it in your Bubble app, you will integrate workflow with elements. As an example, if you want to upload a file when a button is clicked, you will edit the workflow of that button:

  • Add a new action to your button’s workflow
  • Choose 'Plugins' and select 'Get Upload URL' from the Backblaze API
  • Then as a second action in the workflow, choose 'Upload File' and set the dynamic values as per the requirement (filename and content type)

After these steps, your Bubble app should now be able to call Backblaze B2's APIs through the API Connector you set up, allowing you to upload files to the bucket you created.

Bubble.io and Backblaze B2 integration usecase

Scenario: An online course platform that uses Bubble.io for its web development needs to store large amounts of video content for their courses. They want a secure, scalable and cost-effective video storage solution. This is where Backblaze B2 could be integrated for storing and retrieving the video content.

Solution: Integrating Bubble.io with Backblaze B2

Web Development with Bubble.io:
The online platform uses Bubble.io for the web application development. This includes designing user interface, creating user profiles, managing course catalogs and embedding video content into the platform.

Integration Preparation:
The platform signs up for Backblaze B2 storage service. They generate an API key which will be used for the Bubble.io integration. They then choose a proper region for storing their data to optimize latency.

Setting Up the Integration:
The platform uses the Backblaze B2 plugin in Bubble.io, where they need to provide the API key and bucket name. They set up workflows in Bubble.io to upload, fetch and delete video content through Backblaze B2 plugin actions.

Workflows for Data Storage and Retrieval:
When an administrator uploads a course video, a dedicated workflow is triggered. The video file is transferred to Backblaze B2 storage using the configured plugin action. After the upload, Backblaze B2 returns an unique file id that is stored in Bubble.io for later use.
In order for the end users to access the course videos, another workflow is used. When an end user chooses a course, the workflow fetches the video content from Backblaze B2 using the stored file id.

Storage Management in Backblaze B2:
The video content is securely stored in Backblaze B2. Their lifecycle policies and scalable storage options allow the platform to manage storage costs effectively.

Benefits:

Data Storage: By using Backblaze B2 as their cloud storage solution, the platform can leverage secure, scalable and economical storage for their video content.

Automation: By integrating Backblaze B2 with Bubble.io, the platform automates its video content storage and retrieval, reducing manual labor and operational overhead.

Cost-efficiency: Backblaze B2 offers affordable rates for data storage and retrieval, making it an excellent choice for platforms with large data storage needs.

By leveraging the integration of Bubble.io and Backblaze B2, the online course platform can focus more on delivering quality content rather than worrying about data storage and costs.

Explore More Valuable No-Code Resources

No-Code Tools Reviews

Delve into comprehensive reviews of top no-code tools to find the perfect platform for your development needs. Explore expert insights, user feedback, and detailed comparisons to make informed decisions and accelerate your no-code project development.

Explore

WeWeb Tutorials

Discover our comprehensive WeWeb tutorial directory tailored for all skill levels. Unlock the potential of no-code development with our detailed guides, walkthroughs, and practical tips designed to elevate your WeWeb projects.

Explore

No-Code Tools Comparison

Discover the best no-code tools for your projects with our detailed comparisons and side-by-side reviews. Evaluate features, usability, and performance across leading platforms to choose the tool that fits your development needs and enhances your productivity.

Explore
Want to Enhance Your Business with Bubble?

Then all you have to do is schedule your free consultation. During our first discussion, we’ll sketch out a high-level plan, provide you with a timeline, and give you an estimate.

Book a free consultation

By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.

Cookie preferences