npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@showell-labs/showell-web-app-client

v1.2.15

Published

Client for managing plugins and postMessage interfaces

Downloads

3

Readme

Showell Web App Client

This is a tool to make discussing with Showell app or API easier. Import it as regular package, initialize and start communicating!

Import

import WebAppClient from '@showell-labs/showell-web-app-client/lib';

Initialization

WebAppClient.init(
  plugins: RequestedServiceDefinitions,
  env: 'prod' | 'dev',
  channel: 'app' | 'api' | 'auto' = 'auto',
  credentials?: {
      username: string;
      authToken: string;
  }
)

Init returns a promise you can wait for, to ensure that it's ready before you start making any calls.

| Parameter | Meaning | Default | | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | | plugins | Import and include the plugins you want to use here. This is an object where keys are known plugin names | required | | env | If working in production or developement mode | required | | channel | Used to specify if client should try to communicate with App over the postMessage or with API over the Fetch. Auto means that client tries to check if known constants or globals are found that indicate it's being run within WebView of the app | auto | | credentials | If you want to use API mode, you must provide credentials for client to fetch identity for you | undefined |

Plugins

List of supported plugins:

  • DownloadPlugin - Manage offline content, check download status, force downloading etc. App only.
  • FilePlugin - Get information about file(s) or folder(s). App & API.
  • IdentityPlugin - Manage Showell user. This plugin is always included. App & API.
  • SelectedPlugin - Manually use the selected feature of the app. App only.
  • SyncPlugin - Control how app syncs contents between local database and server. App only.
  • UiPlugin - Trigger specific UI actions like showing or hiding navbar. App only.

All plugins can be found from plugins folder. You must provide a set of plugins you plan on using when calling init.

import FilePlugin from '@showell-labs/showell-web-app-client/lib/plugins/FilePlugin';

// ...

WebAppClient.Client.init(
  plugins: { filePlugin: FilePlugin },
  // ...
)

If you don't really care about code splitting and you are feeling lazy, you can also do this:

import { ALL_PLUGINS } from '@showell-labs/showell-web-app-client/lib';

// ...

WebAppClient.Client.init(
  plugins: ALL_PLUGINS,
  // ...
)

Object keys are specific to plugin and it's the same name thats in folder name but the first letter is lower cased.
Prefer TypeScript

Usage

Once you have initialized the client and waited for it to be ready, you can start doing calls. Client provides service method for getting specific plugin. Here's how you would list files in directory called Photos.

const files = await WebAppClient.Client.service('filePlugin').listDir('Photos');

Advanced

In case you need to call plugin directly through postMessage, or call Showell API directly, you can use makePluginCall and makeApiCall functions from client.