Skip to content

Commit

Permalink
Tweak UMD docs in browser README
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterKale committed Nov 25, 2024
1 parent e5589ad commit 14a2520
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions packages/browser/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<!-- omit in toc -->

# @simplewebauthn/browser
# @simplewebauthn/browser <!-- omit in toc -->

![WebAuthn](https://img.shields.io/badge/WebAuthn-Simplified-blueviolet?style=for-the-badge&logo=WebAuthn)
[![npm (scoped)](https://img.shields.io/npm/v/@simplewebauthn/browser?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@simplewebauthn/browser)
[![JSR](https://jsr.io/badges/@simplewebauthn/browser?style=for-the-badge)](https://jsr.io/@simplewebauthn/browser)
![Browser Support](https://img.shields.io/badge/Browser-ES5+-brightgreen?style=for-the-badge&logo=Mozilla+Firefox)
![Browser Support](https://img.shields.io/badge/Browser-ES2021+-brightgreen?style=for-the-badge&logo=Mozilla+Firefox)
![Browser Support](https://img.shields.io/badge/Browser-ES5-brightgreen?style=for-the-badge&logo=Mozilla+Firefox)

- [@simplewebauthn/browser](#simplewebauthnbrowser)
- [Installation](#installation)
- [Node LTS 20.x and higher](#node-lts-20x-and-higher)
- [Deno v1.43 and higher](#deno-v143-and-higher)
- [UMD](#umd)
- [ES5](#es5)
- [ES2021](#es2021)
- [Documentation](#documentation)
- [Installation](#installation)
- [Node LTS 20.x and higher](#node-lts-20x-and-higher)
- [Deno v1.43 and higher](#deno-v143-and-higher)
- [UMD](#umd)
- [ES2021](#es2021)
- [ES5](#es5)
- [Documentation](#documentation)

## Installation

Expand All @@ -39,25 +37,25 @@ This package can also be installed via **unpkg** by including the following scri
`<head>` element. The library's methods will be available on the global **`SimpleWebAuthnBrowser`**
object.

> NOTE: The only difference between the two packages below is that the ES5 bundle includes
> TypeScript's `tslib` runtime code. This adds some bundle size overhead, but _does_ enable use of
> `supportsWebAuthn()` in older browsers to show appropriate UI when WebAuthn is unavailable.
> NOTE: The only difference between the two packages below is that the ES5 bundle includes some
> polyfills for older browsers. This adds some bundle size overhead, but _does_ enable use of
> `browserSupportsWebAuthn()` in older browsers to show appropriate UI when WebAuthn is unavailable.
#### ES5
#### ES2021

If you need to support WebAuthn feature detection in deprecated browsers like IE11 and Edge Legacy,
include the `ES5` version:
If you only need to support modern browsers, include the `ES2021` version:

```html
<script src="https://unpkg.com/@simplewebauthn/browser/dist/bundle/index.es5.umd.min.js"></script>
<script src="https://unpkg.com/@simplewebauthn/browser/dist/bundle/index.umd.min.js"></script>
```

#### ES2021
#### ES5

If you only need to support modern browsers, include the `ES2021` version:
If you need to support WebAuthn feature detection in deprecated browsers like IE11 and Edge Legacy,
include the `ES5` version:

```html
<script src="https://unpkg.com/@simplewebauthn/browser"></script>
<script src="https://unpkg.com/@simplewebauthn/browser/dist/bundle/index.es5.umd.min.js"></script>
```

## Documentation
Expand Down

0 comments on commit 14a2520

Please sign in to comment.