# @wochit/embedded

> Power your organization with video creation

Latest version **2.0.3** (published 2023-09-19) · GPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install @wochit/embedded
pnpm add @wochit/embedded
yarn add @wochit/embedded
bun add @wochit/embedded
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2023-09-19 |
| First published | 2022-05-03 |
| Weekly downloads | 0 |
| License | GPL-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 55.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Wochit LTD |
| Maintainers | subx7, nir.latin, zen2dip, galweissman, ronen.perez |
| Keywords | wochit, wochit-inside, site-integration, embedded-video-editor |

## Links

- npm: https://www.npmjs.com/package/@wochit/embedded
- Repository: https://github.com/wochit/wochit-embedded
- Homepage: https://github.com/wochit/wochit-embedded#readme
- Issues: https://github.com/wochit/wochit-embedded/issues
- npm.io page: https://npm.io/package/@wochit/embedded

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2023-09-19
- 2.0.2 — 2023-02-16
- 2.0.0 — 2022-07-18
- 1.0.0 — 2022-06-22
- 0.0.0-rc.3 — 2022-05-24
- 0.0.0-rc.2 — 2022-05-24
- 0.0.0-rc.1 — 2022-05-18
- 0.0.0-rc.0 — 2022-05-03

## README

# @wochit/embedded NPM module


* [Documentation](https://docs.wochit.com)
* [Using NPM module](#using-npm-module)
* [Using script from CDN](#using-script-from-cdn) 


### Intro
https://user-images.githubusercontent.com/3756473/167427983-89c60590-a1f5-4c6c-9e95-bb54facdfddd.mp4



### Using [NPM](https://www.npmjs.com/package/@wochit/embedded) module

#### Install
```shell
npm i @wochit/embedded
```
```shell
yarn add @wochit/embedded
```
```shell
pnpm add @wochit/embedded
```

#### Using default import
```javascript
import wt from '@wochit/embedded';

wt.config({ clientId, userToken });

document.querySelector('.video-editor-btn').addEventListener('click', () => {
  wt.openVideoEditor({});
});
```

#### Using named import
```javascript
import { config, openVideoEditor } from '@wochit/embedded';

config({ clientId, userToken });

document.querySelector('.video-editor-btn').addEventListener('click', () => {
  openVideoEditor({});
});
```

### Using script from CDN
* async IIFE (non-blocking)
  ```xhtml
  <script type="application/javascript">
    (function (window, document, tag, url, name, a, m) {
      window['__wochit_object_name__'] = name;
      window[name] =
        window[name] ||
        function () {
          (window[name].q = window[name].q || []).push(arguments);
        };
      (a = document.createElement(tag)), (m = document.getElementsByTagName(tag)[0]);
      a.async = 1;
      a.src = url;
      m.parentNode.insertBefore(a, m);
    })(window, document, 'script', 'https://embedded.wochit.com/latest.min.js', 'wt');
  </script>
  ```
  
* sync (blocking)
  ```xhtml
  <script
    src="https://embedded.wochit.com/latest.min.js"
    type="application/javascript"
  ></script>
  ```

Then somewhere in your app:
```javascript
window.wt('config', { clientId, userToken });

document.querySelector('.video-editor-btn').addEventListener('click', () => {
  window.wt('openVideoEditor', {});
});
```

#### Subresource Integrity ([SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity))
* To find integrity string for given version please check-out the [Releases](https://github.com/wochit/wochit-embedded/releases) page.
* Use versioned CDN link, for example: embedded.wochit.com/**#.#.#**.min.js
* add `crossorigin` and `integrity` attributes depending on usage like so:
```javascript
...
a.setAttribute('crossorigin', 'anonymous');
a.setAttribute('integrity', 'PASTE_INTEGRITY_STRING');
// paste the above before this line:
a.src = url;
...
```

```xhtml
<script
  src="https://embedded.wochit.com/#.#.#.min.js"
  type="application/javascript"
  crossorigin="anonymous"
  integrity="PASTE_INTEGRITY_STRING"
></script>
  ```

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