0.1.13 • Published 9 months ago

@mosohq/magic-link-sdk v0.1.13

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

Table of Contents

Getting Started

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

npm install @mosohq/magic-link-sdk

Usage

This SDK relies on chrome manifest v3 using the concept of Isolated and Main 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

// Script is self executing
import '@mosohq/magic-link-sdk/dist/main';

isolated-world.js

// Script is self executing
import '@mosohq/magic-link-sdk/dist/isolated';

manifest.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

// Script is self executing
import '@mosohq/magic-link-sdk/dist/main';

isolated-world.js

// Script is self executing
import '@mosohq/magic-link-sdk/dist/isolated';
0.1.13

9 months ago

0.1.12

9 months ago

0.1.11

9 months ago

0.1.9

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago