Socket
Socket
Sign inDemoInstall

@elabox/elastos-connectivity-sdk-js

Package Overview
Dependencies
286
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @elabox/elastos-connectivity-sdk-js

Elastos JS connectivity SDK to bridge mobile Apps with Elastos wallets


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Elastos Connectivity Client JS SDK

Installation

npm i --save @elastosfoundation/elastos-connectivity-sdk-js

Angular apps:

Add SDK styles to your main scss file:

@import "~@elastosfoundation/elastos-connectivity-sdk-js/dist/bundle.css";

Usage example

import { connectivity, Hive } from '@elastosfoundation/elastos-connectivity-sdk-js';
import { EssentialsConnector } from '@elastosfoundation/essentials-connector-client-browser';

// If willing to let users use Elastos Essentials to handle operations:
connectivity.registerConnector(new EssentialsConnector());

let dataSync = new Hive.DataSync.HiveDataSync(userVault);

Architecture

This connectivity SDK contains:

  • Access (DIDAccess, HiveAccess ...) entry points to easily request private identity information from third-party apps, such as DID credentials, hive authentication credentials, payment with wallet, executing smart contracts, etc.
  • A mechanism made of connectors, in order to dynamically add custom providers for the access services.
  • By default, only a Local Identity Connector is built-in. This connector is required by all dApps in order to let new users easily join the application while they don't have a decentralized identity yet, but also by app store reviewer teams as app stores usually don't accept applications that force users to depend on a third party wallet application to sign in or do major operations. Local identities provide a built-in DID and hive storage environment for a quick start.
  • Additional connectors such as the Elastos Essentials Connector or any custom connector can be added to let end users use their favorite way to use their identity. By adding the Essentials connector, for instance, end users can pick "Essentials" in the list, and all decentralized operations open the external Elastos Essentials application to request user confirmation. Each application decides which connectors it wants to provide to its users.
  • UI interfaces for Generic prompts and Local identity prompts are also provided with a built-in default implementation that prompts end-users with default popups for convenience. Though, those interfaces can be overridden by the application in order to build a custom UI.

Development

Build for distribution

npm run build

The generated output is in dist/.

Build for development

npm run dev

Runs webpack in watch mode to auto-rebuild the project on every file change.

How to publish to npmjs.com

Publishing account (NPM)

  • Organization: @elastosfoundation
  • Owner: @benjaminpiette

Useful commands

  • npm adduser (once)
  • npm login (once)
  • Increase version number in package.json
  • npm publish --access=public

FAQs

Last updated on 12 Sep 2022

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc