Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@livechat/accounts-sdk

Package Overview
Dependencies
Maintainers
49
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@livechat/accounts-sdk

SDK for 'Sign in with LiveChat'.

  • 2.0.0-rc.2
  • npm
  • Socket score

Version published
Weekly downloads
760
decreased by-9.63%
Maintainers
49
Weekly downloads
 
Created
Source

accountsSDK

accountsSDK is a small library that installs the "Sign in with LiveChat" button on any website or app. It also wraps OAuth flow in an easy-to-use API.

Installation

npm install --save @livechat/accounts-sdk

Usage

import { AccountsSDK } from '@livechat/accounts-sdk';

// create new SDK instance with it's options
const sdk = new AccountsSDK({
  client_id: '<your_app_client_id>'
});

// use one of available methods to authorize a user
// popup (must be run in an event hadler to avoid the popup beeing blocked)
sdk.popup().authorize((err, authorizeData) => {
})

// browser redirect
sdk.redirect().authorize()

sdk.iframe().authorize((err, authorizeData) => {
})

Options

  • client_id string required registered client ID
  • prompt string use consent to force consent prompt in a popup and redirect flows
  • response_type='token' string OAuth response type, use token or code
  • popup_flow='auto' string auto - don't show popup when credentials are not required, manual - always show popup
  • state string OAuth state param, auto generated by SDK when empty
  • verify_state=true bool a function that returns transaction should verify if the state matches
  • scope string - custom scope list, must be a subset of preconfigured client ID scopes
  • redirect_uri string OAuth redirect URI - current location by default
  • email_hint string fill in an email hint in forms
  • server_url='https://accounts.livechat.com' string authorization server url
  • tracking object tracking querystring params
  • transaction.namespace='com.livechat.accounts' string transaction keys prefix
  • transaction.key_length=32 number transaction random state length
  • transaction.force_local_storage=false bool try to use local storage instead of cookies
  • pkce.enabled=true bool Oauth 2.1 PKCE extension enabled for code grant
  • pkce.code_verifier string override auto generated code verifier
  • pkce.code_verifier_length=128 number code verifier length, between 43 and 128 characters https://tools.ietf.org/html/rfc7636#section-4.1
  • pkce.code_challange_method='S256' string code challange method, use S256 or plain

FAQs

Package last updated on 21 Sep 2020

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc