New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@carlomigueldy/atlantis-world-auth

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@carlomigueldy/atlantis-world-auth

Authentication module for authenticating to the game API.

  • 1.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Atlantis World Auth

Authentication module for authenticating to the game API.

Getting Started

Install the package

yarn add @atlantis-world/auth --dev # or `npm i -D @atlantis-world/auth`

Optional but recommended, install web3modal package

yarn add web3modal --dev # or `npm i -D web3modal`

Import and use createAuthClient

import { createAuthClient } from "@atlantis-world/auth";

// Optional but recommended; You can use anything to grab web3 the provider
import Web3Modal from "web3modal"; 


async function example() {
  const web3Modal = new Web3Modal({
    network: "mainnet",
  });
  const provider = await web3Modal.connect();
  
  const auth = createAuthClient(provider, {
    apiBaseUrl: process.env.API_BASE_URL,
  });

  // Login
  const authentiacteResult = await atlantisWorldAuth.authenticate();
  /**
   * { 
   *  user: { ... }, 
   *  access_token: "...", 
   *  token_type: "..." 
   * } 
   */ 
  console.log(authentiacteResult);

  // Grab current authenticated user object
  const currentUser = await atlantisWorldAuth.currentUser(authentiacteResult.access_token);
  /**
   * { 
   *  _id: "...",
   *  address: "0x...",
   *  name: "...",
   *  created_at: "...",
   *  updated_at: "...",
   *  deleted_at: null,
   * } 
   */ 
  console.log(currentUser);
}

FAQs

Package last updated on 26 Sep 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc