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

@wishcore/wish-sdk

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wishcore/wish-sdk

Wish API for node. Used for building Wish Apps.

  • 0.4.0-beta-19
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
113
decreased by-8.13%
Maintainers
1
Weekly downloads
 
Created
Source

Wish Api

A library for building Wish applications.

Install

npm install @wishcore/wish-sdk

Example

const { App } = require('@wishcore/wish-sdk');

const app = new App({
    name: process.env.SID || 'MyApp',
    corePort: parseInt(process.env.CORE, 10) || 9094,
    protocols: ['chat'] });

app.on('ready', (ready) => {
    app.request('identity.create', ['John Doe'], (err, data) => {
        if (err && data.code === 304) { return console.log('Using existing identity'); }
        console.log('Identity created:', err, data);
    });
});

app.on('online', (peer) => {
    app.request('services.send', [peer, Buffer.from('Permissionless innovation!')], (err, data) => {
        // sent or not?
    });
});

app.on('frame', (peer, data) => {
    app.request('identity.get', [peer.ruid], function(err, user) {
        console.log(user.alias, 'says:', data.toString());
    });
});

Keywords

FAQs

Package last updated on 25 Oct 2023

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