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 🙏

© 2025 – Pkg Stats / Ryan Hefner

marcedivault-sdk

v1.0.8

Published

Official Node.js SDK for integrating with MarcediVault's OAuth system.

Readme

MarcediVault SDK

Official Node.js SDK for securely integrating with the MarcediVault OAuth System by Xentrius.

This SDK enables third-party apps to:

  • Exchange authorization codes for tokens
  • Refresh access tokens
  • Verify and decode JWT access tokens
  • Protect routes with JWT middleware
  • (Optionally) Fetch authenticated user info

🔧 Installation

npm install marcedivault-sdk

⚙️ SDK Setup
Before using any features, initialize the SDK with your credentials:


import { init } from 'marcedivault-sdk';

init({
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
  jwtSecret: 'your-jwt-verification-secret-or-public-key'
});

✨ Features
🔐 Exchange Authorization Code

import { exchangeToken } from 'marcedivault-sdk';

const { access_token, refresh_token, expires_in } = await exchangeToken({
  code: 'auth_code_from_redirect',
  redirectUri: 'https://your-app.com/callback'
});



♻️ Refresh Access Token
import { refreshToken } from 'marcedivault-sdk';

const newTokens = await refreshToken('your-refresh-token');


✅ Verify Access Token
js
Copy code
import { verifyAccessToken } from 'marcedivault-sdk';

try {
  const user = verifyAccessToken('access-token');
  console.log(user); // JWT payload (e.g. sub, email, etc.)
} catch (err) {
  console.error('Token is invalid:', err.message);
}
🛡️ Secure Express Routes
js
Copy code
import express from 'express';
import { authMiddleware } from 'marcedivault-sdk';

const app = express();

app.get('/profile', authMiddleware(), (req, res) => {
  res.json({ user: req.user });
});
👤 Fetch User Info (Optional)
js
Copy code
import { getUserInfo } from 'marcedivault-sdk';

const user = await getUserInfo('access-token');
console.log(user);
📘 Example Usage
js
Copy code
import {
  init,
  exchangeToken,
  refreshToken,
  verifyAccessToken,
  authMiddleware,
  getUserInfo
} from 'marcedivault-sdk';

init({
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
  jwtSecret: 'your-verification-key'
});

// Use in Express app
app.get('/dashboard', authMiddleware(), (req, res) => {
  res.json({ message: 'Secure route', user: req.user });
});
🔐 Security
This SDK:

Only transmits data over HTTPS

Does not store any tokens internally

Requires JWT secret or public key for verification

Can be extended with encryption (e.g. via ZeroSight Protocol)

🧠 Requirements
Node.js v16+

Uses ES Modules (type: "module")