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

@tsc_tech/medusa-plugin-auth-passkey

v0.0.10

Published

A starter for Medusa plugins.

Readme

Compatibility

This starter is compatible with versions >= 2.4.0 of @medusajs/medusa.

@tsc_tech/medusa-plugin-auth-passkey

This plugin allows users to register through email and mobile number using OTP. After registration, users are prompted to add a passkey. For already registered users, the generated passkey can be used to log in. If a user does not add a passkey during registration, they can add it later from the account section.

Usage

  1. Registration:

    • Users can register using their email or mobile number.
    • An OTP will be sent to the provided email or mobile number for verification.
    • After successful verification, users will be prompted to add a passkey.
  2. Login:

    • Registered users can log in using their email/mobile number and the generated passkey.
    • If a user did not add a passkey during registration, they can add it later from their account section.
  3. Adding Passkey:

    • Users can navigate to the account section to add or update their passkey at any time.

Installation

To install the @tsc_tech/medusa-plugin-auth-passkey, run the following command:

npm install @tsc_tech/medusa-plugin-auth-passkey

or

yarn add @tsc_tech/medusa-plugin-auth-passkey

Additionally, install the auth-plugin package:

npm install @simplewebauthn/server -D
npm install @simplewebauthn/types -D

or

yarn add @simplewebauthn/server -D
yarn add @simplewebauthn/types

Configuration

Step 1: Update Medusa Configuration Modify your medusa-config.ts to include the auth provider:

import EmailPassAuthProvider from "@medusajs/medusa/auth-emailpass";


module.exports = defineConfig({
modules: [
  ...
    {
      resolve: "@medusajs/medusa/auth",
      options: {
        providers: [
          {
            resolve: EmailPassAuthProvider,
            id: "emailpass",
          },
          {
            resolve:
              "@tsc_tech/medusa-plugin-auth-passkey/providers/auth-passkey",
            id: "auth-passkey",
            options: {
              rpID: process.env.RP_ID,
              rpName: process.env.RP_NAME,
              enableHTTPS: process.env.ENABLE_HTTPS === "true" ? true : false,
            },
          },
          {
            resolve: "@tsc_tech/medusa-plugin-auth-passkey/providers/auth",
            id: "otp",
          },
        ],
      },
    },
  ...],
  plugins: [
    {
      resolve: "@tsc_tech/medusa-plugin-auth-passkey",
      options: {},
    },
    ],
})

Run migrations after installation

npx medusa db:migrate

Step 2. Set Up Environment Variables In your .env file, define the following variables:

RP_ID=localhost
RP_NAME=your-rp-name
FRONTEND_URL=http://localhost:8000  // your frontend url

Step 3: See the example (auth-passkey-storefront-example) to integrate with frontend (Medusa Starter Template).

Important: You must have a notification provider to send the otp to email or phone.

Features

Secure Authentication: Leverages passkeys for enhanced security.

OTP-based Verification: Ensures user identity with one-time passwords.

Seamless Integration: Easily integrates with Medusa’s authentication system.

Customizable: Environment variables allow configuration for different use cases.

Multi-Platform Support: Works with both email and mobile authentication.

Troubleshooting

If you encounter issues while setting up the plugin, consider the following:

Database Migration Issues: Run npx medusa db:migrate again and ensure your database is correctly set up.

Environment Variables Not Loading: Check if .env is correctly configured and restart your Medusa server.

Passkey Not Prompting: Ensure HTTPS is enabled if running on a production server.

Contribution

We welcome contributions to improve this plugin! If you have suggestions or find issues, feel free to submit a pull request or open an issue in the repository.