open-index/open-npm huggingface dataset:
npm package: @mosohq/magic-link-sdk
Description: <h3 align="center">Moso Magic Link SDK</h3>
Latest version: 0.1.17

<h3 align="center">Moso Magic Link SDK</h3>

## Table of Contents
- [Getting Started](#getting_started)
- [Installation](#installation)
- [Usage](#usage)


## Getting Started <a name = "getting_started"></a>
Getting started with Moso Magic Links SDK is very easy and fast.  Developers can either import the script in their existing files, or create new files (below) and add those to the manifest.

## Installation <a name = "installation"></a>
```
npm install @mosohq/magic-link-sdk
```

## Usage <a name="usage"></a>

This SDK relies on chrome manifest v3 using the concept of Isolated and Main [content scripts](https://developer.chrome.com/docs/extensions/develop/concepts/content-scripts).  The Isolated and Main worlds each have a script that needs to be imported.  There are no exports from the scripts, they are self executing to ensure they run on load.


**Example 1:**

Create `main-world.js` and `isolated-world.js` scripts in your extension.  In each file, import the respective files.

`main-world.js`
```javascript
// Script is self executing
import '@mosohq/magic-link-sdk/dist/main';
```

`isolated-world.js`
```javascript
// Script is self executing
import '@mosohq/magic-link-sdk/dist/isolated';
```

`manifest.json`
```json
{
  ...
  "content_scripts": [
    {
      "matches": [
        "https://*/*"
      ],
      "js": [
        "isolated-world.js"
      ]
    },
    {
      "matches": [
        "https://*/*"
      ],
      "js": [
        "main-world.js"
      ],
      "world": "MAIN"
    }
  ]
  ...
}
```


**Example 2:**

If your extension already has a Main and Isolated world scripts, you can import the files instead:

`main-world.js`
```javascript
// Script is self executing
import '@mosohq/magic-link-sdk/dist/main';
```

`isolated-world.js`
```javascript
// Script is self executing
import '@mosohq/magic-link-sdk/dist/isolated';
```