Socket
Book a DemoInstallSign in
Socket

@cubist-labs/cubesigner-react

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cubist-labs/cubesigner-react

CubeSigner Core React Library. Contains our CubeSigner Provider for accessing the sdk in external React applications and widgets for basic CubeSigner interactions.

latest
npmnpm
Version
0.0.4
Version published
Maintainers
0
Created
Source

CubeSigner React

Package for interacting with CubeSigner sessions within your React application.

Provider

// filename: main.tsx

import { Provider } from "@cubist-labs/cubesigner-react";

... your setup code ...


createRoot(document.getElementById('root')!).render(
    <CubeSignerProvider env='gamma'>
      <App />
    </CubeSignerProvider>
)
// Establish the environment your CubeSigner API is targeting.
env: "beta" | "gamma" | "prod";

// For portfolio and asset data, provide an ankr api key
ankrApiKey: string;

When your provider is established, you will be able to establish a CubeSigner session in your local storage by adding a <Login /> component in your application.

// filename: someView.tsx

// ...

return (
  <>
    Please log in
    <Login />
  </>
);

<Login/> also provides callbacks to interact with various states of the login process.

  /**
   * Optional callback for reacting to an initialized login.
   * @return {Promise<void>}
   */
  onLoginInitialized?: () => void;
  /**
   * Optional callback for reacting to an mfa request for login.
   * @return {Promise<void>}
   */
  onMfaRequired?: () => void;
  /**
   * Optional callback for reacting to a successful login.
   * @return {Promise<void>}
   */
  onSuccess?: () => void;
  /**
   * Optional callback for reacting to an error in the login process.
   * @param {Error} e - error thrown.
   * @return {Promise<void>}
   */
  onError?: (e?: Error) => void;

Keywords

CubeSigner

FAQs

Package last updated on 30 Nov 2024

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.