Skip to main content

Masa SDK

/ Exports


yarn add @masa-finance/masa-sdk --save

npm i @masa-finance/masa-sdk --save



import { Masa } from "@masa-finance/masa-sdk";
import { providers } from "ethers";

// with metamask
const provider = new providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();

export const masa = new Masa({


import { Masa } from "@masa-finance/masa-sdk";
import { providers, Wallet } from "ethers";

const provider = new providers.JsonRpcProvider("your blockchain rpc endpoint");

const wallet = new Wallet("your private key", provider);

export const masa = new Masa({
signer: wallet,


For a detailed interface description see Masa


KeyTypeDescriptionDefault Value
cookiestringCookie value. Don't set this manually unless you know what you do!
walletethers.Signer or ethers.WalletThe Wallet instance to use when interacting with the Blockchain."wallet with a random private key"
apiUrlstringThe API Endpoint of the Masa Infrastructure for dev, test, beta and production.""
environmentstringThe environment to use dev, test, beta, production."dev"
networkstringThe network name ie. "goerli"."goerli"
arweave.hoststringThe arweave host to use for loading metadata.""
arweave.portnumberThe arweave port to use for loading metadata.443
arweave.protocolstringThe arweave protocol to use for loading metadata."https"
arweave.loggingbooleanTurn arweave logging on or off.false
new Masa({
// cookie value for connecting with the backend
cookie: "my fancy cookie",
// wallet object is always mandatory
// api endpoint to the masa infrastructure
apiUrl: "",
// masa environment dev, test, beta, prod
environment: "prod",
// network name to use goerli, mainnet
network: "goerli",
// arweave endpoint to use
arweave: {
host: "",
port: 443,
protocol: "https",
logging: false,