Skip to content

Replace jose dependency with Web Crypto API #5

Closed

Description

@melvincarvalho

Summary

Replace the jose npm dependency with the native Web Crypto API to achieve a truly zero-dependency library.

Motivation

  • The library advertises itself as "minimal, zero-build" but still pulls in jose (~45kb)
  • Modern browsers ship Web Crypto API with full support for JWT signing, verification, and key generation
  • Removing jose means zero dependencies, smaller bundle, no supply chain risk

Web Crypto equivalents

jose function Web Crypto replacement
generateKeyPair crypto.subtle.generateKey
SignJWT crypto.subtle.sign + manual JWT construction
jwtVerify crypto.subtle.verify
exportJWK crypto.subtle.exportKey('jwk', ...)
calculateJwkThumbprint crypto.subtle.digest('SHA-256', ...)
createRemoteJWKSet fetch + crypto.subtle.importKey
decodeJwt JSON.parse(atob(token.split('.')[1]))

Acceptance criteria

  • All jose imports replaced with Web Crypto API calls
  • jose removed from package.json dependencies
  • Zero npm dependencies
  • Existing tests still pass

Activity

  1. added a commit that references this issue on Mar 5, 2026
    2dc4c22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions