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

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.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696910625837/81173814-cd8e-4f57-b440-6855b8650312.png align="center")

**Step 2:**

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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696911100746/c83bd354-9514-43dd-a037-aaf4d62a8e75.png align="center")

**Step 3:**

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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696911190475/28f4a6b9-4f66-43a9-9465-6a5c8f722cd5.png align="center")

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.

```javascript
//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](https://twitter.com/NocodeTalks).

**Checkout My Bubble Plugin Course** - Use coupon code "THEBUBBLEGROUP" at checkout for 10% discount.

%[https://nocodetalks.co/bubbleplugin]
