npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@metaverse-ese-test-example/node-sdk

v1.0.0-alpha.33

Published

The MNet Node SDK is a JavaScript/TypeScript client that provides easy integration with the MNet API, enabling you to interact with various services like memes and spaces. The SDK uses `axios` for HTTP requests and provides built-in caching using `axios-c

Downloads

1,209

Readme

MNet Node SDK

The MNet Node SDK is a JavaScript/TypeScript client that provides easy integration with the MNet API, enabling you to interact with various services like memes and spaces. The SDK uses axios for HTTP requests and provides built-in caching using axios-cache-interceptor.

Installation

You can install the MNet Node SDK via npm:

npm install @metaverse-ese-test-example/node-sdk

or using yarn:

yarn add @metaverse-ese-test-example/node-sdk

Usage

Importing the SDK

You can import the MNetClient class from the SDK and instantiate it with your API key and environment.

import { MNetClient } from '@metaverse-ese-test-example/node-sdk';

const client = new MNetClient({
  apiKey: 'YOUR_API_KEY',
  env: 'dev', // can be 'dev', 'staging', or 'prod'
});

Overwriting API Key

You can also overwrite the API key by manually providing an authorization header in individual method calls. This is useful if you need to temporarily use a different key.

const memes = await client.memeService.getMemes({
  headers: {
    'Authorization': 'Bearer NEW_API_KEY'
  }
});
console.log(memes);

Available Services

The SDK provides several services to interact with the MNet platform.

Meme Service

The MemeService allows you to interact with the meme-related endpoints. Below is an example of how to use it:

const memes = await client.memeService.getMemes();
console.log(memes);

Space Service

The SpaceService allows you to manage spaces:

const spaces = await client.spaceService.getSpaces();
console.log(spaces);

User Token (used for frontend-sdk)

const userTokenData = {
  externalUserId
  externalProjectId
  firstName
  lastName
  role
  email
};
const encodeKey = {
  keyId: "WBEw7pKn0TMCAYc7WDvdo",
  privateKey: `-----BEGIN RSA PUBLIC KEY-----
MIICCgKCAgEAlnd5vGP/1bzcndN/yRD+ZTd6tuemxaJd+12bOZ2QCXcTM03AKSp3
NE5QMyIi13PXMg+z1uPowfivPJ4iVTMaW1U00O7JlUduGR0VrG0BCJlfEf852V71
TfE+2+EpMme9Yw6Gs/YAuOwgVwu3n/XF0il3FTIm1oY1a/MA79rv0RSscnIgCaYJ
e86LWm+H6753Si0MIId/ajIfYYIndN6qRIlPsgagdL+kljUSPEiIzmV0POxTltBo
tXL1t7Mu+meJrY85MXG5W8BS05+q6dJql7Cl0UbPK152ziakB+biMI/4hYlaOIBT
3KeOcz/Jg7Zv21Y0tbdrZ5osVrrNpFsCV7PGyQIUDVmmnCHrOEBS2XM5zOHzTxMl
JQh3Db318rB5415zuBTzrO+20++03kH4SwZEEBg1SDAInYwLOWldbTuZuD0Hx7P2
g4a3OqHHVOcAgtsHgmU7/zCgCIETg4KbRdpSsqOm/YJDWWoLDTwvKnH5QHSBacq1
kxbNAUSuLQESkfZq1Dw5+tdBDJr29bxjmiSggyittTYn1B3iHACNoe4zj9sMQQIf
j9mmntXsa/leIwBVspiEOHYZwJOe5+goSd8K1VIQJxC1DVBxB2eHxMvuo3eyJ0HE
DlebIeZy4zrE1LPgRic1kfdemyxvuN3iwZnPGiY79nL1ZNDM3M4ApSMCAwEAAQ==
-----END RSA PUBLIC KEY-----`
};

const token = createUserToken(userTokenData, encodeKey);

Configuration

The SDK requires a few configuration parameters:

  • apiKey: Your API key for accessing the MNet API.
  • env: The environment to be used. Available options are:
    • dev: Development environment
    • staging: Staging environment
    • prod: Production environment

Scripts

The SDK provides several npm scripts for development and building:

  • build: Compiles the TypeScript code to JavaScript using tsup.
  • clean: Cleans the build output and dependencies.
  • dev: Runs the build in watch mode for development purposes.
  • dryrun: Builds and packs the SDK for a dry run of the release.

To build the SDK, run:

npm run build

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

If you'd like to contribute, feel free to open a pull request or issue on the GitHub repository.

Support

For any issues or questions, please contact [email protected].