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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@securepasspro/sdk

v1.0.1

Published

Official JavaScript SDK for SecurePass Pro – secure password generation and API integration with 256-bit encryption.

Readme

SecurePass Pro JavaScript SDK

npm version License: MIT Security

Official JavaScript SDK for SecurePass Pro - The most secure password generator with cryptographically secure 256-bit encryption and zero-storage architecture.

🚀 Features

  • ✅ Cryptographically Secure - 256-bit encryption & CSPRNG
  • ✅ Zero Storage - Passwords never stored on servers
  • ✅ Bulk Generation - Generate up to 1000 passwords at once
  • ✅ Team Management - Add, remove, and manage team members
  • ✅ Usage Tracking - Monitor password generation limits
  • ✅ Cross-Platform - Works in Node.js and browsers
  • ✅ TypeScript Support - Full type definitions included
  • ✅ Enterprise Ready - Role-based access control

📦 Installation

NPM (Recommended)

npm install @securepasspro/sdk

CDN (Browser)

<!-- ES Module -->
<script type="module">
  import SecurePassSDK from 'https://cdn.jsdelivr.net/npm/@securepasspro/sdk@latest/dist/securepasspro.esm.js';
</script>

<!-- UMD (for older browsers) -->
<script src="https://cdn.jsdelivr.net/npm/@securepasspro/sdk@latest/dist/securepasspro.min.js"></script>

Direct Download

Download from GitHub Releases and include in your project.

🔑 Get Your API Key

  1. Log in to SecurePass Pro Dashboard
  2. Go to API Integration tab
  3. Click "Create API Key"
  4. Copy your API key (only shown once!)
  5. Store it securely (environment variable, secret manager, etc.)

📖 Full setup instructions: See GETTING_STARTED.md

🎯 Quick Start

Installation

npm install @securepasspro/sdk

Basic Usage

// ES Modules (Node.js 14+, modern browsers)
import SecurePassSDK from '@securepasspro/sdk';

// CommonJS (Node.js)
// const SecurePassSDK = require('@securepasspro/sdk');

// Initialize with your API key
const sdk = new SecurePassSDK('spro_your-api-key-here');

// Test connection first
const test = await sdk.testConnection();
console.log(test.success); // true

// Generate a secure password
const result = await sdk.generatePassword({ length: 16 });
console.log(result.password); // Your generated password
console.log(result.strength); // 'strong'
console.log(result.quota?.remaining); // Remaining quota

Browser Usage

<!-- Option 1: UMD (works everywhere) -->
<script src="https://cdn.jsdelivr.net/npm/@securepasspro/sdk@latest/dist/securepasspro.min.js"></script>
<script>
  const sdk = new SecurePassSDK('spro_your-api-key-here');
  sdk.generatePassword({ length: 16 }).then(result => {
    console.log(result.password);
  });
</script>

<!-- Option 2: ES Module (modern browsers) -->
<script type="module">
  import SecurePassSDK from 'https://cdn.jsdelivr.net/npm/@securepasspro/sdk@latest/dist/securepasspro.esm.js';
  const sdk = new SecurePassSDK('spro_your-api-key-here');
  const result = await sdk.generatePassword({ length: 16 });
  console.log(result.password);
</script>

📖 Complete getting started guide: GETTING_STARTED.md
📝 See examples: examples/ directory
🤖 Automated releases: AUTOMATED_RELEASES.md

📋 API Reference

Constructor

const sdk = new SecurePassSDK(apiKey, options);

Parameters:

  • apiKey (string, required): Your SecurePass Pro API key (must start with spro_ and be at least 40 characters)
  • options (object, optional):
    • baseURL (string): Custom API URL (default: auto-detected from browser or https://securepasspro.co/api)
    • timeout (number): Request timeout in ms (default: 10000)

⚠️ Important:

  • API key must start with spro_ prefix
  • Requires Enterprise or Annual plan
  • Store API keys securely - never expose in client-side code

Methods

generatePassword(options)

Generate a single secure password.

Options:

  • length (number): Password length, 8-64 characters (default: 16)
  • includeUppercase (boolean): Include uppercase letters (default: true)
  • includeLowercase (boolean): Include lowercase letters (default: true)
  • includeNumbers (boolean): Include numbers (default: true)
  • includeSymbols (boolean): Include symbols (default: true)

Returns:

{
  success: true,
  password: string,
  length: number,
  strength: 'weak' | 'medium' | 'strong' | 'ultra-complex' | 'ultimate-complexity' | 'maximum-complexity',
  entropy: number,
  complexity: string,
  quantumResistant: boolean,
  timestamp: string,
  quota: {
    remaining: number,
    apiKeyId: string
  }
}

Example:

const result = await sdk.generatePassword({
  length: 20,
  includeUppercase: true,
  includeLowercase: true,
  includeNumbers: true,
  includeSymbols: true
});

console.log(result.password); // Generated password
console.log(result.strength); // 'strong'
console.log(result.quota?.remaining); // Remaining quota

generateBulkPasswords(count, options)

Generate multiple passwords (up to 1000).

Parameters:

  • count (number): Number of passwords to generate (1-1000)
  • options (object): Same as generatePassword() options

Returns:

{
  success: true,
  count: number,
  passwords: string[],
  length: number,
  timestamp: string,
  quota: {
    remaining: number,
    apiKeyId: string
  }
}

Example:

const result = await sdk.generateBulkPasswords(10, {
  length: 16
});

console.log(result.passwords); // Array of 10 passwords
console.log(result.count); // 10
console.log(result.quota?.remaining); // Remaining quota

getTeamInfo(teamId)

Get team information and member list.

const teamInfo = await sdk.getTeamInfo('team_12345');
console.log(teamInfo.team.members); // Team members

addTeamMember(teamId, email, role)

Add a new member to your team.

const result = await sdk.addTeamMember('team_12345', '[email protected]', 'member');

removeTeamMember(teamId, email)

Remove a member from your team.

const result = await sdk.removeTeamMember('team_12345', '[email protected]');

updateTeamMemberRole(teamId, email, role)

Update a team member's role.

const result = await sdk.updateTeamMemberRole('team_12345', '[email protected]', 'admin');

getUsage()

Get your current usage statistics.

Returns:

{
  name: string,
  email: string,
  plan: 'Basic' | 'Pro' | 'Enterprise' | 'Annual',
  nextBillingDate: string,
  passwordLimit: number,
  randomizationCount: number,
  usedGenerations: number,
  signupDate: string,
  billingCycle: 'monthly' | 'annual',
  amount: number,
  apiKey: {
    quotaRemaining: number,
    apiKeyId: string
  }
}

Example:

const usage = await sdk.getUsage();
console.log(usage.plan); // 'Enterprise'
console.log(usage.usedGenerations); // Passwords used this month
console.log(usage.passwordLimit); // Total limit
console.log(usage.apiKey?.quotaRemaining); // Remaining API quota

testConnection()

Test API connection and authentication.

Returns:

{
  success: boolean,
  message: string,
  data?: {
    success: boolean,
    message: string,
    timestamp: string,
    user: {
      email: string,
      plan: string
    },
    apiKey: {
      id: string,
      permissions: string[]
    },
    version: string
  }
}

Example:

const test = await sdk.testConnection();
if (test.success) {
  console.log('✅ Connection successful!');
  console.log('User:', test.data.user.email);
  console.log('Plan:', test.data.user.plan);
} else {
  console.error('❌ Connection failed:', test.message);
}

🔒 Security Features

  • Input Validation - All inputs are validated and sanitized
  • Request Timeout - 10-second timeout protection
  • Rate Limiting - Built-in rate limiting support
  • API Key Validation - Secure API key format checking
  • Character Limits - 8-64 character password limits
  • Bulk Limits - Maximum 1000 passwords per bulk request
  • Error Handling - Secure error messages without data exposure

📊 Plan Limits

| Plan | Monthly Limit | Bulk Generation | Team Management | |------|---------------|-----------------|-----------------| | Basic | 10 passwords | ❌ | ❌ | | Pro | 60 passwords | ✅ (60/month) | ✅ | | Enterprise | Unlimited | ✅ (Unlimited) | ✅ | | Annual | Unlimited | ✅ (Unlimited) | ✅ |

🛠️ Complete Examples

Error Handling

Always handle errors properly:

async function generatePasswordSafely() {
  try {
    const result = await sdk.generatePassword({ length: 16 });
    return result.password;
  } catch (error) {
    if (error.message.includes('401')) {
      console.error('❌ Authentication failed. Check your API key.');
    } else if (error.message.includes('429')) {
      console.error('❌ Rate limit exceeded. Please try again later.');
    } else if (error.message.includes('403')) {
      console.error('❌ Access denied. Check your plan and permissions.');
    } else {
      console.error('❌ Error:', error.message);
    }
    throw error;
  }
}

React Component

import React, { useState } from 'react';
import SecurePassSDK from '@securepasspro/sdk';

function PasswordGenerator() {
  const [password, setPassword] = useState('');
  const sdk = new SecurePassSDK('your-api-key');

  const generatePassword = async () => {
    try {
      const result = await sdk.generatePassword({ length: 20 });
      setPassword(result.password);
    } catch (error) {
      console.error('Failed to generate password:', error);
    }
  };

  return (
    <div>
      <button onClick={generatePassword}>Generate Password</button>
      {password && <p>Generated: {password}</p>}
    </div>
  );
}

Node.js Server

const SecurePassSDK = require('@securepasspro/sdk');

const sdk = new SecurePassSDK('your-api-key');

async function generatePasswords() {
  try {
    // Generate single password
    const password = await sdk.generatePassword({ length: 32 });
    console.log('Password:', password.password);

    // Generate bulk passwords
    const bulkPasswords = await sdk.generateBulkPasswords(10, { length: 16 });
    console.log('Bulk passwords:', bulkPasswords.passwords);

    // Check usage
    const usage = await sdk.getUsage();
    console.log('Usage:', usage);
  } catch (error) {
    console.error('Error:', error.message);
  }
}

generatePasswords();

Team Management

const sdk = new SecurePassSDK('your-api-key');

// Get team info
const teamInfo = await sdk.getTeamInfo('team_12345');
console.log('Team members:', teamInfo.team.members);

// Add new member
await sdk.addTeamMember('team_12345', '[email protected]', 'member');

// Update role
await sdk.updateTeamMemberRole('team_12345', '[email protected]', 'admin');

🚨 Important Notes

  1. API Key Security - Never expose your API key in client-side code or public repositories
  2. API Key Format - Must start with spro_ and be at least 40 characters
  3. Plan Requirements - SDK access requires Enterprise or Annual plan
  4. Rate Limits - Respect the rate limits for your plan
  5. Error Handling - Always handle errors gracefully
  6. Testing - Use testConnection() to verify your setup before generating passwords
  7. Environment Variables - Store API keys in environment variables:
    const sdk = new SecurePassSDK(process.env.SECUREPASS_API_KEY);

📖 Documentation

🆘 Support

📄 License

MIT License - see LICENSE file for details.


Built with ❤️ by the SecurePass Pro Team

The most secure password generator with cryptographically secure 256-bit encryption and zero-storage architecture.