Use bcryptjs via CDN
mainYou can use bcryptjs directly in the browser via several CDNs. Note that when using the ESM variant in a browser, you must stub out the crypto import (e.g., using an import map). Bundlers typically handle this automatically.
jsDelivr
- ESM:
https://cdn.jsdelivr.net/gh/dcodeIO/bcrypt.js@TAG/index.js - ESM:
https://cdn.jsdelivr.net/npm/bcryptjs@VERSION/index.js - UMD:
https://cdn.jsdelivr.net/npm/bcryptjs@VERSION/umd/index.js
unpkg
- ESM:
https://unpkg.com/bcryptjs@VERSION/index.js - UMD:
https://unpkg.com/bcryptjs@VERSION/umd/index.js
Replace TAG or VERSION with a specific version or omit it to use the latest.