# attach-embeds

> Wrapper for Attach Embeds

Latest version **1.5.1614271328** (published 2021-02-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install attach-embeds
pnpm add attach-embeds
yarn add attach-embeds
bun add attach-embeds
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.1614271328 |
| Published | 2021-02-25 |
| First published | 2019-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Attach dev-team |
| Maintainers | attach-live |
| Keywords | attach-live, attach, embeds |

## Links

- npm: https://www.npmjs.com/package/attach-embeds
- npm.io page: https://npm.io/package/attach-embeds

## Recent versions

- 1.5.1614271328 (latest) — 2021-02-25
- 1.4.1581727501 — 2020-02-15
- 1.3.1573429648-developers — 2019-11-27
- 1.3.1573429648-prefix — 2019-11-14
- 1.3.1573429648 — 2019-11-10

## README

# Attach Embeds

Injects

```html
<script src="https://embeds.attach.live/v1#attach:initialize=manual" async defer></script>
```

to the page, caching calls until it's loaded and forwarding to the `attach` global otherwise.

## Installation

npm

```
$ npm install --save attach-embeds
```

yarn

```
$ yarn add attach-embeds
```

## Usage

```js
import * as attach from 'attach-embeds'

if (!attach.isInitialized()) {
	attach.setProperties({
		'attach:error-reporting': false,
		'attach:error-handling': 'display',
	})
	attach.initialize()
}

attach.setProperty('attach:project:identity-color', 'blue')
```

## attach.initialize()

Initializes the API. You always have to call this manually when using this package. You can also call it multiple times, as extra calls have no effect.

## attach.isInitialized()

Returns `true` if the API is initialized, `false` otherwise.

May not necessarily return `true` right after calling `attach.initialize()`.

## attach.setProperty()

Set a global property. Accepts `name` and `value`.

See https://github.com/attach-live/attach-properties

## attach.setProperties()

Set global properties. Accepts an object where key is the property name.

See https://github.com/attach-live/attach-properties

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