# Introduction of the @vereign/lib-seal

**URL:** <https://community.vereign.com/t/introduction-of-the-vereign-lib-seal/298>\
**Category:** dev\
**Created:** [June 9, 2021, 1:43pm UTC](https://community.vereign.com/t/introduction-of-the-vereign-lib-seal/298 "2021-06-09T13:43:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![markin.io](https://community.vereign.com/user_avatar/community.vereign.com/markin.io/32/334_2.png) [@markin.io](https://community.vereign.com/u/markin.io)\
**Post date:** [June 9, 2021, 1:43pm UTC](https://community.vereign.com/t/introduction-of-the-vereign-lib-seal/298/1 "2021-06-09T13:43:42Z")

</div>

@alexey.lunin @zdravko hey guys.

This discussion is a follow-up of the [https://community.vereign.com/t/a-time-to-consider-publishing-our-javascript-libs-to-the-outer-world/283/10?u=markin.io](https://community.vereign.com/t/a-time-to-consider-publishing-our-javascript-libs-to-the-outer-world/283/10).

Let me start directly from the painful points in the current situation with `iframe`, `@vereign/vframe`, and `@vereign/light-utils`

# Drawbacks of the current libraries architecture

- `@vereign/light-utils` is heavy and 95% of it’s functionality used by `iframe` and `web-verification-app` only.
- `@vereign/vframe` and `iframe` needs to use shared code of public API errors (`MimeVerificationError`, `SealAPIError`, `StatusAPIError`). That’s the reason of having them sticked in a single repo.
- There’s certainly confusion between `iframe` and `@vereign/vframe` during the discussions.
- If a third-party integrator wants to read seals from emails and load iframes, he/she needs to install both `@vereign/light-utils` and `@vereign/vframe` which is really inconvenient.

# Proposed solution

So, after some thinking I came up with the idea of aggregating existing functionality into a lightweight integration library called `@vereign/lib-seal` which is going to expose:

- `IframeService` - to load iframe APIs
- `SealService` - to extract seals from MIME
- List of public API errors

With this optimization, Integrators (Chrome Extension and Outlook Add-in) will be able to sufficiently cover the [verification routine](https://code.vereign.com/seal/building-blocks/iframe#recipient-read-and-verify-email-publish-receipt-record) at their side using only a single library. And pretty much the same goes for the `signing` routine.

# What’s going to happen to the old libs

- `@vereign/vframe` - gets removed
- `@vereign/light-utils` - preferably it should be used only by Web Verification App and Iframe. Chrome Extension and Outlook Add-In will be able to work without it.

# List of dependents for @vereign/lib-seal

- `Chrome Extension` and `Outlook Add-in`. Using the whole API of the library.
- `iframe` - uses Public API errors only
- `@vereign/mime-normalizer` - needs only `SealService` in tests

---

<div class="post-metadata">

**Author:** ![zdravko](https://community.vereign.com/user_avatar/community.vereign.com/zdravko/32/344_2.png) [@zdravko](https://community.vereign.com/u/zdravko)\
**Post date:** [June 10, 2021, 1:41pm UTC](https://community.vereign.com/t/introduction-of-the-vereign-lib-seal/298/2 "2021-06-10T13:41:02Z")

</div>

I’m ok with the proposed solution.

---

<div class="post-metadata">

**Author:** ![alexey.lunin](https://community.vereign.com/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@alexey.lunin](https://community.vereign.com/u/alexey.lunin)\
**Post date:** [June 10, 2021, 2:35pm UTC](https://community.vereign.com/t/introduction-of-the-vereign-lib-seal/298/3 "2021-06-10T14:35:30Z")

</div>

I’m ok with this solution
