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

@dscvr-one/canvas-client-sdk

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dscvr-one/canvas-client-sdk

SDK for iframes apps to connect to dscvr host using postMessage rpc

  • 1.1.1
  • npm
  • Socket score

Version published
Weekly downloads
76
decreased by-14.61%
Maintainers
0
Weekly downloads
 
Created
Source

@dscvr-one/canvas-client-sdk

This SDK can be used by DSCVR Canvas Applications to communicate with the DSCVR Frontend.

Current features include:

  • Get the current user and content.
  • Prompt the user to open an external link.
  • Execute wallet transactions.

Installation

Install with your favorite package manager:

npm install @dscvr-one/canvas-client-sdk

yarn

yarn add @dscvr-one/canvas-client-sdk

Usage

To use the SDK:

  1. Import CanvasClient and CanvasInterface into your typescript project:
import { CanvasInterface, CanvasClient } from '@dscvr-one/canvas-client-sdk';
  1. Instantiate the CanvasClient:
const canvasClient = new CanvasClient();
  1. Start the handshake:
const response = await canvasClient.ready();
//
if (response) {
  // The handshake allows access to the user and the content that the application is embedded in.
  const user: CanvasInterface.Handshake.User = response.untrusted.user;
  const content: CanvasInterface.Handshake.Content = response.untrusted.content;
  // ...
}

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, feel free to open an issue or submit a pull request.

Keywords

FAQs

Package last updated on 30 Aug 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

  • 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