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

@balena/jellyfish-client-sdk

Package Overview
Dependencies
Maintainers
3
Versions
2223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@balena/jellyfish-client-sdk

HTTP client SDK for Jellyfish

  • 13.11.8
  • latest
  • Source
  • npm
  • Socket score

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

Jellyfish Client SDK

This is a client side library to interact with the Jellyfish API. It's meant to provide high level useful functionality to the web UI and any other clients.

Usage

Below is an example how to use Jellyfish:

import { getSdk } from "@balena/jellyfish-client-sdk";

// Create a new SDK instance, providing the API url and prefix
const sdk = getSdk({
    apiUrl: "https://api.ly.fish",
    apiPrefix: "api/v2/",
});

(async () => {
    const sessionContract = await sdk.auth.login({
        username: "jellyfish",
        password: "jellyfish",
    });

    if (sessionContract) {
        // Authorise the SDK
        sdk.setAuthToken(sessionContract.id);

        // Get and output a list of all channel contracts
        const channelContracts = await sdk.card.getAllByType('channel@1.0.0');
        console.log('channelContracts:', JSON.stringify(channelContracts, null, 2));

        // Query for a specific user and output results
        const userContract = await window.sdk.query({
            type: 'object',
            properties: {
                type: {
                    const: 'user@1.0.0',
                },
                slug: {
                    const: 'user-foobar',
                },
            },
        });
        console.log('userContract:', JSON.stringify(userContract, null, 2));

        // Query for a specific user with links and output results
        const userContractWithLinks = await window.sdk.query({
            type: 'object',
            properties: {
                type: {
                    const: 'user@1.0.0',
                },
                slug: {
                    const: 'user-foobar',
                },
            },
            $$links: {
                'is member of': {
                    type: 'object',
                },
            },
        });
        console.log('userContractWithLinks:', JSON.stringify(userContractWithLinks, null, 2));
    }
})();

FAQs

Package last updated on 03 Sep 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