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

moonbase-sdk

v1.1.4

Published

SDK for the moonbase authentication system.

Downloads

67

Readme

Moonbase SDK Documentation

The Moonbase SDK is a powerful tool for interacting with the Moonbase API. This documentation will guide you through the process of setting up and using the SDK in your project.

Moonbase Request Access

Requeset access for Moonbase API: https://discord.gg/HhR6qRDFmJ

Installation

You can install the Moonbase SDK package using npm or yarn:

npm install moonbase-sdk
# or
yarn add moonbase-sdk

Getting Started

To get started with the Moonbase SDK, you need to create an instance of the MoonbaseClient class.

import MoonbaseClient from 'moonbase-sdk';

const moonbase = new MoonbaseClient('https://your-api-url.com', {
  public_api_key: 'your-public-api-key',
  private_api_key: 'your-private-api-key' // optional
});

Account Operations

Creating a New User

const newUser = {
  email: '[email protected]',
  username: 'newUser',
  password: 'password123',
};

moonbase.account.userNew(newUser)
  .then((response) => {
    console.log('User created:', response);
  })
  .catch((error) => {
    console.error('Error creating user:', error);
  });

User Authentication

const userCredentials = {
  username: 'existingUser',
  password: 'password456',
};

moonbase.account.user(userCredentials)
  .then((response) => {
    console.log('User authenticated:', response);
  })
  .catch((error) => {
    console.error('Authentication failed:', error);
  });

More Account Operations

You can explore other account-related operations such as user PIN management, password reset, and license activation using the provided methods in the moonbase.account object.

Admin Operations

Creating a New Product

const newProduct = {
  name: 'New Product',
  version: '1.0.0',
  price: 99.99,
};

moonbase.admin.createProduct(newProduct)
  .then((response) => {
    console.log('Product created:', response);
  })
  .catch((error) => {
    console.error('Error creating product:', error);
  });

Managing Licenses

You can perform various license-related operations like creating, deleting, and getting license information using the methods in the moonbase.admin object.

More Admin Operations

Explore other admin operations such as managing users, blacklists, and file links using the provided methods in the moonbase.admin object.

TypeScript Types

The Moonbase SDK provides TypeScript type definitions to ensure type safety in your code. You can refer to the provided types when working with the SDK to benefit from code completion and type checking.

Example TypeScript Usage

import { UserNew } from 'moonbase-sdk';

const newUser: UserNew = {
  email: '[email protected]',
  username: 'newUser',
  password: 'password123',
};

Happy coding with Moonbase!