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

tommy_extension_sdk

v0.1.1

Published

SDK for building Tommy extensions

Downloads

2

Readme

Tommy Extension SDK

The Tommy Extension SDK enables developers to build custom extensions and integrations that extend Tommy's core functionality.

The SDK itself emulates the live Tommy environment, so you can develop extensions on your local machine that will integrate seamlessly with the live deployment.

Getting Started

Install the SDK by typing:

npm install tommy_extension_sdk

Open up the APIKEY file in the tommy_extension_sdk folder and paste in your Tommy API Key.

Now launch the server emulator:

node server

To load the emulator point your browser at http://localhost:4000

Building Extensions

When you first load the emulator you will notice there are a couple of demo extensions available in the menu. The source code for these demo extensions is located in the /extensions folder, and they are a good place to start when building your own extensions.

The basic folder structure is extremely simple:

extensions/{your_extension_name}
.
|-- manifest.json
|-- main.html

Manifest File

Each extension package contains a single manifest.json file. The manifest.json file contains all the metadata information, configuration options, and a list of views to be exposed by your extension.

A minimal manifest.json file with both client and admin views would look like something like this:

{
  "name": "Hello World",
  "package": "hello",
  "version": "0.0.1",
  "author": "Kam Low",
  "private": false,

  "views": [
    {
      "name": "Hello World",
      "file": "client/main.html",
      "type": "page",
      "scope": "client",
      "framed": false,
      "permissions": {}
    },
    {
      "name": "Hello World Admin",
      "file": "admin/form.html",
      "type": "form",
      "scope": "admin",
      "framed": false,
      "permissions": {}
    }
  ]
}

The manifest.json options are as follows:

  • name: (String) The human readable name of the extension.
  • package: (String) The machine readable name of the extension in underscore case.
  • version: (String) The release version number (must be incremented on each release).
  • author: (String) The extensions author name (may be individual or organisation).
  • private: (Boolean) The privacy setting that determines if this extension is usable by other Tommy users or not.
  • views: (Object) The object containing the views to be exposed on the interface.

Exposing Views

Each extension may contain multiple views to be exposed on the interface. Views are defined within the views option in the manifest.json file.

  • name: (String) The view page title.
  • file: (String) The relative view path to the view HTML file ie. client/main.html.
  • type: (String) The view type, current supported are page and form.
  • scope: (String) The view type, current supported are client and admin.
  • framed: (Boolean) Weather or not the view should be loaded inside an iframe for security.
  • permissions: (Object) The view permission object.

Special care should be taken when defining the view application scope, which has two options; client, and admin. Views with the client scope will be exposed within the client side mobile app used by employees, and views with the admin scope will be exposed within the backend app used by employers.