# anchor-link-browser-transport

> Vanilla JS browser transport for Anchor Link

Latest version **3.6.1** (published 2024-07-23) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install anchor-link-browser-transport
pnpm add anchor-link-browser-transport
yarn add anchor-link-browser-transport
bun add anchor-link-browser-transport
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.6.1 |
| Published | 2024-07-23 |
| First published | 2020-02-02 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 890.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jnordberg, jesta |

## Links

- npm: https://www.npmjs.com/package/anchor-link-browser-transport
- Homepage: https://github.com/greymass/anchor-link-browser-transport
- npm.io page: https://npm.io/package/anchor-link-browser-transport

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.0.3

## Recent versions

- 3.6.1 (latest) — 2024-07-23
- 3.2.3 (next) — 2021-07-22
- 3.6.0 — 2024-04-11
- 3.5.1 — 2022-07-15
- 3.5.0 — 2022-05-11
- 3.3.0 — 2022-03-29
- 3.2.5 — 2021-08-11
- 3.2.4 — 2021-07-28
- 3.2.2 — 2021-07-22
- 3.2.1 — 2021-06-04
- 3.2.0 — 2021-06-04
- 3.1.3 — 2021-03-23
- 3.1.2 — 2021-03-18
- 3.1.1 — 2021-03-13
- 3.1.0 — 2021-03-12
- … 33 more at https://npm.io/package/anchor-link-browser-transport/versions

## README

# Anchor Link - Browser Transport [![Package Version](https://img.shields.io/npm/v/anchor-link-browser-transport.svg?style=flat-square)](https://www.npmjs.com/package/anchor-link-browser-transport) ![License](https://img.shields.io/npm/l/anchor-link-browser-transport.svg?style=flat-square)

A transport library for usage of [Anchor Link](https://github.com/greymass/anchor-link) within a web browser environment.

## Basic usage

A transport is required for Anchor Link to communicate with clients. In most examples we use the browser transport with no configuration, like so:

```ts
const transport = new AnchorLinkBrowserTransport()
const link = new AnchorLink({transport})
```

Parameters can be passed to the transport during construction as an object, allowing for the following optional changes:

```ts
const transport = new AnchorLinkBrowserTransport({
    /** CSS class prefix, defaults to `anchor-link` */
    classPrefix: 'my-css-prefix',
    /** Whether to inject CSS styles in the page header, defaults to true. */
    injectStyles: true,
    /** Whether to display request success and error messages, defaults to true */
    requestStatus: false,
    /** Local storage prefix, defaults to `anchor-link`. */
    storagePrefix: 'my-localstorage-prefix',
    /**
     * Whether to use Greymass Fuel for low resource accounts, defaults to false.
     *  Note that this service is not available on all networks, and will automatically
     *  determine based on chain id if it should be enabled or not.
     */
    disableGreymassFuel: false,
    /** Referral account to use for Greymass Fuel. */
    fuelReferrer: 'teamgreymass',
})
const link = new AnchorLink({transport})
```

## Developing

You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.

Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.

## License

[MIT](./LICENSE.md)

---

Made with ☕️ & ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).

---
_Source: https://npm.io/package/anchor-link-browser-transport · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
