Socket
Book a DemoInstallSign in
Socket

@3id/ui-provider

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@3id/ui-provider

An interface for applications to impelement any user interface 3ID connect service.

latest
Source
npmnpm
Version
0.4.1
Version published
Maintainers
3
Created
Source

3ID Connect Service UI Provider

An interface for applications to impelement any user interface 3ID connect service.

NOTE: Mostly internal use, names and interfaces are likely to change soon and support currently being added in the 3ID Connect Service and/or 3ID Manager Library

Use

npm install @ceramicstudio/ui-provider

Example usage:

import { UIProvider, ThreeIDManagerUI } from '@ceramicstudio/ui-provider'

// Implement the following UI Handlers 
const UIMethods: UIProviderHandlers = {
  // Ask user to continue with 3box account migration, true to
  // migrate, false to cancel request
  prompt_migration: async (ctx, params) => {
    //...
  },
   // Ask user to skip migration after migration faile, true to 
   // create new account, false to cancel request
  prompt_migration_skip: async (ctx, params) => {
    //...
  },
  // Known migration failure bugs, ask user to continue with new
  // account instead, true to create new, false to cancel request
  prompt_migration_fail: async (ctx, params) => {
    //...
  },
  // Ask user to connect account to existing account or create new.
  // Displayed when CAIP10 has no existing link in network.
  prompt_account: async (ctx, params) => {
    //...
  },
  // Permission request for app to access 3id-connect
  prompt_authenticate: async (ctx, params) => {
    //...
  },
  // Any errors during flows
  inform_error: async (ctx, params) => {
    //...
  },
  // Inform UI that a flow has ended and no futher requests are expected 
  inform_close: async (ctx, params) => {
    //...
  }
}

//Create a 3ID Connect UI Provider 
const provider = new UIProvider(UIMethods)

// TODO: provider consumption in other libraries

Maintainers

@zachferland

Keywords

3id

FAQs

Package last updated on 19 Apr 2022

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