Skip to main content
BETA
HomeIntegration BuilderAPI ReferenceGuides
View Mirror World on Github
Join the Discord server

Language:

JavaScript/TypeScript Integration Guide

This guide will walk you through the setup process for the Mirror World Smart SDK on JavaScript/TypeScript.

1. Create a Developer Account

Create a developer account on the Developer dashboard. Create project and create an API Key. If you already have an API Key, you may skip this step and proceed to the next one.

2. Install the JS Mirror World SDK

The Mirror World SDK for JavaScript implements a TypeScript-compatible client that can be used for both in the browser and Node.js. Install it with the package manager of your choice:

install.sh
Copy

_8
# With Yarn
_8
yarn add @mirrorworld/web3.js
_8
_8
# With npm
_8
npm install @mirrorworld/web3.js
_8
_8
# With pnpm
_8
pnpm install @mirrorworld/web3.js

3. Import the SDK

You can now import the Mirror World SDK into your project.

install.sh
main.ts
Copy

_14
import { MirrorWorld, ClusterEnvironment } from "@mirrorworld/web3.js"
_14
_14
const mirrorworld = new MirrorWorld({
_14
apiKey: "YOUR_SECRET_API_KEY",
_14
env: ClusterEnvironment.testnet, // Can be ClusterEnvionment.mainnet for mainnet
_14
})
_14
_14
async function main() {
_14
await mirrorworld.login()
_14
await mirrorworld.getTokens()
_14
await mirrorworld.getNFTs()
_14
}
_14
_14
main()

4. Initialize SDK with API Key

With your API Key, you can now initialize the SDK in your project.

install.sh
main.ts
Copy

_14
import { MirrorWorld, ClusterEnvironment } from "@mirrorworld/web3.js"
_14
_14
const mirrorworld = new MirrorWorld({
_14
apiKey: "YOUR_SECRET_API_KEY",
_14
env: ClusterEnvironment.testnet, // Can be ClusterEnvionment.mainnet for mainnet
_14
})
_14
_14
async function main() {
_14
await mirrorworld.login()
_14
await mirrorworld.getTokens()
_14
await mirrorworld.getNFTs()
_14
}
_14
_14
main()

5. Start building!

You can start invoking the various methods on the MirrorWorld instance. Enjoy!

install.sh
main.ts
Copy

_14
import { MirrorWorld, ClusterEnvironment } from "@mirrorworld/web3.js"
_14
_14
const mirrorworld = new MirrorWorld({
_14
apiKey: "YOUR_SECRET_API_KEY",
_14
env: ClusterEnvironment.testnet, // Can be ClusterEnvionment.mainnet for mainnet
_14
})
_14
_14
async function main() {
_14
await mirrorworld.login()
_14
await mirrorworld.getTokens()
_14
await mirrorworld.getNFTs()
_14
}
_14
_14
main()

Going Further

Great! At this point you're pretty much ready to start doing building with the JavaScript SDK for Mirror World. There are a few things you can do to proceed from here:

Getting Support

If you're stuck or just looking for support, you may also schedule a support call with our team.

JavaScript/TypeScript Integration Guide

This guide will walk you through the setup process for the Mirror World Smart SDK on JavaScript/TypeScript.

1. Create a Developer Account

Create a developer account on the Developer dashboard. Create project and create an API Key. If you already have an API Key, you may skip this step and proceed to the next one.

2. Install the JS Mirror World SDK

The Mirror World SDK for JavaScript implements a TypeScript-compatible client that can be used for both in the browser and Node.js. Install it with the package manager of your choice:

3. Import the SDK

You can now import the Mirror World SDK into your project.

4. Initialize SDK with API Key

With your API Key, you can now initialize the SDK in your project.

5. Start building!

You can start invoking the various methods on the MirrorWorld instance. Enjoy!

Going Further

Great! At this point you're pretty much ready to start doing building with the JavaScript SDK for Mirror World. There are a few things you can do to proceed from here:

Getting Support

If you're stuck or just looking for support, you may also schedule a support call with our team.

install.sh
CopyExpandClose

_8
# With Yarn
_8
yarn add @mirrorworld/web3.js
_8
_8
# With npm
_8
npm install @mirrorworld/web3.js
_8
_8
# With pnpm
_8
pnpm install @mirrorworld/web3.js

Edit this page on GitHub

Copyright © Mirror World, Inc. 2023

Home

Tutorials

Guides

API Reference