Socket
Socket
Sign inDemoInstall

front-broker-connection

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

front-broker-connection

Front Finance brokerage connection client lib


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

JS library for integrating with Front Finance

Generating connection method

import { createFrontConnection } from 'front-b2b';

// ...

const frontConnection = createFrontConnection({
  authLink: '<GENERATED_AUTH_LINK>',
  onBrokerConnected: (brokerData: FrontPayload) => {
    // use broker account data
  },
  onExit: (error?: string) => {
    if (error) {
      // handle error
    } else {
      // ...
    }
  }

Immediate connection

Front connection to open immediately when your page or component renders. This is useful for scenarios without any user input (such as clicking a button)

ℹ️ See full source code example at react-example/src/ui/Front.tsx

import { createFrontConnection } from 'front-b2b'
import { FrontPayload } from 'front-b2b/esm/types'
import { Front } from 'front-b2b/esm/FrontLink'

// ...

const [frontConnection, setFrontConnection] = useState<Front | null>(null)

useEffect(() => {
  setFrontConnection(createFrontConnection(options))
}, [])

useEffect(() => {
  frontConnection?.open()
}, [frontConnection])

return <></>

Event fired connection

Await event to fire before starting Front connection.

import { createFrontConnection } from 'front-b2b'
import { FrontPayload } from 'front-b2b/esm/types'
import { Front } from 'front-b2b/esm/FrontLink'

// ...

const [frontConnection, setFrontConnection] = useState<Front | null>(null)

useEffect(() => {
  setFrontConnection(createFrontConnection(options))
}, [])

return (
  <button
    onClick={() => {
      frontConnection?.open()
    }}
  >
    Connect
  </button>
)

Available Connection configuration options

ℹ️ See src/types/index.ts for exported types.

createFrontConnection arguments
keytype
authLinkstring
onBrokerConnected(payload: FrontPayload) => void
onExit((error?: string | undefined) => void) | undefined
createFrontConnection return value
keytype
open() => void
dispose() => void

Typescript support

TypeScript definitions for front-b2b-link are built into the npm package.

FAQs

Package last updated on 08 Jun 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

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