Socket
Book a DemoInstallSign in
Socket

@metomic/alias-core

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metomic/alias-core

## What is this? Client-side (web) javascript library and UI elements that create a metomic alias for a given email.

0.3.0
latest
npmnpm
Version published
Weekly downloads
9
Maintainers
1
Weekly downloads
 
Created
Source

alias-core

What is this?

Client-side (web) javascript library and UI elements that create a metomic alias for a given email.

When should I use it?

Probably only if you're writing a library that provides metomic alias functionality in your chosen framework.

For an example, see @metomic/alias-react

How do I use it?

You probably don't want to - there's likely a higher level library. But if you're sure:

importing

import {
  Alias, 
  EncryptionOverlay,
  AliasToggle
} from '@metomic/alias-core

constructing an alias (no ui)

Alias({ appId: 'zx123' }).secure("an-email@somewhere.com")
  .then( ... )

mutably binding to an input element

const run  = Alias.dom.bindToInput(appId, purpose, inputElement, (state) => {
  /* optional state-change callback here. Options:
   state = { status: 'loading' }
   state = { status: 'error', error: 'error' }
   state = { status: 'complete', result: 'alias@metomic' }
   state = { status: 'reset', result: 'original-email' }
  */
})

run(true) // performs securing action on input
run(false) // reverts securing action on input

manually managing entire flow

  const overlay = Alias.dom.createOverlayController(inputEl)
  const { doToggle } = createSecuringContext(appId, purpose, inputEl, function onStateChange(state){
    // deal with states
    overlay.setActive(state === 'loading')
  })


  doToggle(true) // triggers securing action on input
  doToggle(false) // reverts securing action on input
  

FAQs

Package last updated on 02 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.