Integrating Node.js Libraries in Bubble Plugins: A Step-by-Step Guide

Search for a command to run...

No comments yet. Be the first to comment.
I have included all the information related to how you can build the Bubble plugin in this series. Check my course on how to build plugin from scratch- https://nocodetalks.co/bubbleplugin
If you have noticed when you write console.log("This should be print"); in the Bubble plugin editor's action part, you can't see the text "This should be print" in the browser, making it hard to debug your plugin. This is because the action functio...
Most websites use CSS :hover for hover effects. You can see them in the stylesheet, copy them, move on. Framer doesn't do that. Framer uses a React animation library (Framer Motion) with a whileHove

https://www.youtube.com/watch?v=63Lkpw8fGAw Introduction to Xano: A No-Code Backend Solution When it comes to choosing the right backend service for your project, Xano emerges as a noteworthy contender. This video explores the various facets of Xan...
Hi Everyone, This newsletter will be a little different from the ones before. In this edition, I'm excited to launch the Xano Cohort program, which I will be running. The program will start on May 6th for 6 weeks. Why I am starting this: Whenever I...

Learn what workload units are in Bubble, how they are calculated, and discover actionable strategies to optimize and reduce your app's workload units for better performance and cost efficiency. One think before moving forward- If you are reading thi...

There are instances when you may need to access an element created within the Bubble editor. For example, in a plugin, you might want to return the number of characters a user types into an input element. Follow these steps: Step 1: Enable the "Expos...

There are many instances when you may want to create a plugin based on an existing Node.js library. For example, you might want to integrate a Node.js "encryption" library like crypto-js, or integrate the "squids" library to generate YouTube-like IDs for given text.
But how do you add a Node.js library to the Bubble plugin editor?
Follow these steps:
Step 1:
Navigate to the "Action" section of the Bubble editor and create a new server-side action.

Step 2:
Check the box that says "This action uses the node modules."

Step 3:
Now, import the library into the action function using the "require" keyword.

As soon as you add the code to import the library and click outside of the "run_server" function, a warning will appear: "The deployment package for your action is out of date."
Click on this warning to rebuild the "package.json" file.
PS: Bubble does not support the "import" keyword for loading libraries.
If you still see the error "Library is not loaded," try different variations of the "require" keyword.
//try anyone
const Sqids = require('sqids');
const Sqids = require('sqids').default;
const { Sqids } = require ('sqids');
That's all for this blog. Subscribe for more future updates. Thank you!
Follow me on twitter.
Checkout My Bubble Plugin Course - Use coupon code "THEBUBBLEGROUP" at checkout for 10% discount.