0.0.8 • Published 2 years ago

@credenza3/web-sdk-ext-oauth v0.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

CREDENZA WEB SDK OAuthExtension

Installation

npm i @credenza3/web-sdk-ext-oauth

import { OAuthExtension } from '@credenza3/web-sdk-ext-oauth'

Usage

Create the SDK instance

const sdk = new CredenzaSDK({
  extensions: [new OAuthExtension()],
  ...other sdk params
})

Login with Credenza OAuth2

await sdk.oauth.login({
  scope: 'profile email phone blockchain.evm.write blockchain.evm',
  redirectUrl: window.location.href, // must be configured in client settings

  // defines Authentication flow session duration
  // defaults to 1h
  session_length_seconds?: number

  // explicitly define login type
  type?: OAuthExtension.LOGIN_TYPE.<SELECTED_TYPE>

  // explicitly define passwordless login type
  // only available if `type` set to OAuthExtension.LOGIN_TYPE.PASSWORDLESS`
  passwordless_type?: OAuthExtension.PASSWORDLESS_LOGIN_TYPE<SELECTED_TYPE>
})

Destroy OAuth flow session (Requires user to be logged in)

await sdk.oauth.revokeSession()

Destroy OAuth flow browser session and redirect user.

await sdk.oauth.revokeBrowserSessionWithRedirect(<REDIRECT_URI>)
0.0.8

2 years ago

0.0.5

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.1-rc.8

2 years ago

0.0.1-rc.9

2 years ago

0.0.1-rc.1

2 years ago

0.0.1-rc.2

2 years ago

0.0.1-rc.5

2 years ago

0.0.1-rc.6

2 years ago

0.0.1-rc.0

2 years ago

0.0.1-beta.1

2 years ago

0.0.1-alpha.1

2 years ago

0.0.1-beta.0

2 years ago

0.0.1-alpha.0

2 years ago