Skip to content

Packages

Code sharing in Membrane happens through our package registry. You might’ve already used the registry to install an package like membrane/github or to share your first program.

Once you install a package, it is instantly deployed as a program in your workspace. You can modify the program as you wish and even republish it. Packages are published as <username>/<program>.

Explore and search for packages at ide.membrane.io or membrane.io/share.

Installing

To install a package, select 📦 PACKAGES in the top left of the IDE, find the package you want to install, and click INSTALL.

Publishing

To share your code, you publish it as a package. Right-click a program and select “Publish Package”. If the program you want to share relies on other programs as connections, you’ll have to publish those first.

Note that publishing a package only shares your code—not your program state nor logs.

Unpublishing

To unpublish a package, right-click the program to select “Publish Package…” (same as publishing), click the triple dots menu, and select UNPUBLISH.

If other packages point to the package you want to unpublish as a dependency, you’ll have to unpublish those first, or re-publish them using a different connection.

Updating

If the upstream package that you installed in your workspace has been modified since installation, you can view a diff of the changes and update it right in the IDE. Find the package the same way you initially installed it, select files to see diffs, and click UPDATE to merge the changes into your program.

API integrations

The Membrane team has published many packages that integrate third-party APIs. For example, just as there’s an openai npm package for the OpenAI API, there’s also a membrane/openai Membrane package.

You can select 📦 PACKAGES in the top left of the IDE and search “membrane” to see all packages published by our team. You’ll find:

We used to call these packages “drivers”, but we ditched the extra name. While they tend to follow certain conventions, there’s nothing fundamentally different about them. They are packages—and become programs once installed and running—just like any other package. That means you can create your own programs to integrate APIs and publish for others to install. So if you’ve written some code on Membrane you’re already halfway there!

Surfacing API functionality as nodes in your Membrane graph makes it easy for your programs to interact with external services. Once you get the hang of it, you won’t have to worry much about the quirks of individual APIs since packages follow the same structure. To learn about the implementation details of public API packages in Membrane, read our guide.