Socket
Socket
Sign inDemoInstall

metafab-client

Package Overview
Dependencies
8
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    metafab-client

MetaFab Typescript Client SDK


Version published
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

MetaFab Typescript Client SDK

NPM NPM GitHub Workflow Status

Community-built Typescript client for MetaFab's Web3 API.

The official documentation can be found at: https://trymetafab.com.

Installation

NPM

npm install metafab-client

YARN

yarn add metafab-client

Usage

Authenticate your MetaFab game

import { MetaFabClient, NETWORK } from 'metafab-client';
import type { Game } from 'metafab-client';

const client = new MetaFabClient({
  network: NETWORK.POLY_MAIN,
  username: process.env.METAFAB_ACCOUNT_EMAIL,
  password: process.env.METAFAB_ACCOUNT_PASSWORD,
});

const result = await client.games.auth();
const game: Game = result.data;

Authenticate a MetaFab player

import { MetaFabClient, NETWORK } from 'metafab-client';
import type { Player } from 'metafab-client';

const client = new MetaFabClient({
  network: NETWORK.POLY_MAIN,
  username: process.env.METAFAB_ACCOUNT_EMAIL,
  password: process.env.METAFAB_ACCOUNT_PASSWORD,
});

const result = await client.players.auth(process.env.METAFAB_GAME_PUBLISH_KEY, 'playerUsername', 'p@ssw0rd');
const player: Player = result.data;

Keywords

FAQs

Last updated on 12 Feb 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc