0.4.1 • Published 2 years ago

@3id/ui-provider v0.4.1

Weekly downloads
-
License
(Apache-2.0 OR MI...
Repository
github
Last release
2 years ago

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

0.4.1-rc.0

2 years ago

0.4.1-alpha.1

2 years ago

0.4.1-rc.1

2 years ago

0.4.1

2 years ago

0.4.0-alpha.1

2 years ago

0.4.0-alpha.0

2 years ago

0.4.1-alpha.0

2 years ago

0.3.0

2 years ago

0.2.4

3 years ago

0.2.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago