Skip to content

Authentication system for Ceramic apps that works with blockchain wallets.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

ceramicstudio/js-3id

Repository files navigation

ceramicnetwork Twitter

3ID-Connect

3ID Connect Image

3ID Connect provides 3ID user account management in a iframe, an easy way to access a DID provider, specifically ThreeIdProvider in the browser. It allows users to authenticate, manage, link and permission their 3ID keys to applications.

The library js-3id-did-provider handles most operations and the parent window (application) communicates with the iframe service over an RPC layer.

Getting started

Installation

npm install @3id/connect

Basic usage

import { EthereumAuthProvider, ThreeIdConnect } from '@3id/connect'

// ethProvider is an Ethereum provider and addresses an array of strings
const authProvider = new EthereumAuthProvider(ethProvider, addresses[0])

const threeIdConnect = new ThreeIdConnect()
await threeIdConnect.connect(authProvider)

See the example app for more details

Developement

Prerequisites

yarn v1 and lerna v4 should be installed globally:

npm install -g lerna yarn

Installation

Run yarn install from the root folder, this will install the dependencies and build the packages

Scripts

In the root folder:

  • lint: lints all apps and packages
  • build: builds all packages
  • test:unit: runs unit test
  • test:management: runs integration tests for the management lib with a Ceramic server
  • test:integration: runs integration tests from the integration app with a Ceramic server

Folders

Packages

Apps

  • example: Example usage of 3ID Connect with Ceramic and IDX
  • iframe: 3ID Connect iframe logic and UI
  • integration: 3ID Connect integration tests
  • management: 3ID accounts management UI used by 3ID Connect

Others

  • public: build assets for 3idconnect.org

Licenses

  • Apache-2.0 OR MIT for published packages
  • UIs used by 3ID Connect may use dependencies under other licenses