Get Started
guide on how to install the js-mcs-sdk package and its basic usage
Last updated
Was this helpful?
guide on how to install the js-mcs-sdk package and its basic usage
Last updated
Was this helpful?
Install the package using npm. It is recommended to create a new directory for a new project. Run the init command to setup a package.json file
Set your API Key and Access Token as environment variables in a .env
file. Optionally include your wallet's private key and RPC-URL.
To begin writing a script utilizing the SDK, create a new .js
file.
At the top of this file, require the necessary packages. Since these functions are , we will need to create an async
function to run the SDK methods.
Now inside the asynchronous main
function, we can initialize the SDK
Optionally, you can pass privateKey
to use the onChain Storage upload and payment functions and pass rpcUrl
if you wish to use your own RPC URL (this SDK uses by default).
This SDK is also compatible with our calibration environment on the Mumbai testnet. Use chainName: 'polygon.mumbai'
and generate a new API KEY from