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

@monerium/sdk

Package Overview
Dependencies
Maintainers
2
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@monerium/sdk

Everything you need to interact with Monerium.

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
632
increased by40.76%
Maintainers
2
Weekly downloads
 
Created
Source

@monerium/sdk

Everything you need to interact with Monerium.

This package is in development. Please make sure to check if any future updates contain commits that may change the behaviour of your application before you upgrade.

Authentication

import { MoneriumClient } from 'monerium-js';

const client = await MoneriumClient.create();

// Depending on the authentication method you want to use,
// make sure to pass the correct arguments to the `auth` method.
// Optional arguments can be omitted.

// --- BASIC Authentication --- //

await client.auth({ email: '<required>', password: '<required>' });

// --- BEARER PKCE Authentication --- //

// 1. Redirect to Monerium PKCE Authentication flow.
await client
	.auth({
		client_id: '<required>',
		state: '<recommended>',
		address: '<optional>',
		redirect_uri: '<optional>',
		scope: '<optional>'
	})
	.then(() => {
		// store the `code_verifier` from `client.codeVerifier` for later.
		sessionStorage.setItem('code_verifier', client.codeVerifier);
	});

// User will be redirected to the redirect_url with
// the code and the state in query parameters
// Make sure to compare the state from the response and the one you passed.

// 2. Redeem Code
const bearerProfile = await client.auth({
	client_id: '<required>',
	code: '<required>',
	code_verifier: sessionStorage.getItem('code_verifier'),
	redirect_uri: '<can be omitted if not set in request>',
	scope: '<optional>'
});

// Note: In case steps 1 and 2 are executed in different environments,
// e.g. 1 in the browser and 2 on the server, you can pass a bearer
// profile in order to authenticate as shown below.

client.auth(bearerProfile);

// --- BEARER Client Authentication --- //

await client.auth({ client_id: '<required>', client_secret: '<required>', scope: '<optional>' });

// --- Client Attributes --- //

client.authContext;
client.bearerProfile;

Demo

To check out the demo site for this pacakge, run the following commands:

yarn install
yarn dev

Developing

If you want to make any code contributions, make sure to run the following commands before you pr them:

yarn format
yarn lint
yarn test

Publishing

If you want to modify and publish the package yourself, run the following commands:

yarn package
yarn publish

FAQs

Package last updated on 12 Oct 2022

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