Import module into clouds

Sorry for a silly question if it is,
can I import a npm module into clouds?
such as:


import { OpenSeaPort, Network } from "opensea-js";

Or can I some how import it from front end and send it to clouds ?

For now is not an easy way to do it, one option is to include that library code in the code that you upload for cloud functions, it doesn’t work always as it depends on what other requirements that library has. Someone made that work with vercel to build a single JavaScript file that can be uploaded as cloud code. In the future we plan to make it easier to include a module in cloud functions.

1 Like

like in above sample: OpenSeaPort is a Class type, can we some home send it to clouds inside request.params?

Can you copy it’s code directly in you cloud code?

It is a huge library… I hope may be we can bundle it some how and upload it to clouds as you suggested… :thinking: