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

auth0-webtask-widget

v1.0.6

Published

Embeddable webtask toolkit

Downloads

4

Readme

Auth0 Webtask Widget

Usage

// Get a reference to an existing HTMLElement instance
var containerEl = document.getElementById('container');

// Create a webtask widget in the element with id `container`.
// The webtask widget will prompt the user for their phone # or email address
// the first time they visit the page. Because `storeProfile` is enabled,
// the user's credentials will be saved locally for the next time they visit.
var editor = webtaskWidget.createEditor({
    mount: containerEl,
    storeProfile: true,
});

// The returned editor object is an instance of an A0EditorWidget class that 
// emits certain events and gives programmatic access to some of the underlying
// functionality of the widget.
editor.on('save', function (webtask) {
    console.log('I just saved a webtask that can be accessed at', webtask.url);
});

API

Functions

showCronListing([options])

Create a widget that lists cron jobs associated with the active profile

Kind: global function

| Param | Type | Description | | --- | --- | --- | | [options] | Object | Customize the behaviour and appearance of the widget | | [options.mount] | HTMLElement | Indicate where the widget should be mounted. If not specified the widget will be shown as a modal dialog. | | [options.url] | String | The url of the Webtask cluster to be used. Defaults to https://webtask.it.auth0.com. | | [options.token] | String | The webtask token of the current user. If missing, and no {@see options.readProfile} profided, the SMS/email login flow will be triggered. | | [options.container] | String | The webtask container of the current user. If missing, will be derived from {@see options.token}, from the result of {@see options.readProfile}, or finally from the result of the SMS/email login flow. | | [options.readProfile] | function | A function that should return a Object or a Promise for an object with url, token and container properties. | | [options.writeProfile] | function | A function that will be called with the resolved Profile that should return a Promise that resolves once the profile has been written. | | [options.storageKey] | function | A key that will be used by localStorage to read/write the resolved Profile when you do not use pass in custom {@see options.readProfile} and {@see options.writeProfile} functions. |

showEditor([options])

Create a widget that lets users create or edit Webtasks and Cron Jobs

Kind: global function

| Param | Type | Description | | --- | --- | --- | | [options] | Object | Customize the behaviour and appearance of the widget | | [options.mount] | HTMLElement | Indicate where the widget should be mounted. If not specified the widget will be shown as a modal dialog. | | [options.url] | String | The url of the Webtask cluster to be used. Defaults to https://webtask.it.auth0.com. | | [options.token] | String | The webtask token of the current user. If missing, and no {@see options.readProfile} profided, the SMS/email login flow will be triggered. | | [options.container] | String | The webtask container of the current user. If missing, will be derived from {@see options.token}, from the result of {@see options.readProfile}, or finally from the result of the SMS/email login flow. | | [options.readProfile] | function | A function that should return a Object or a Promise for an object with url, token and container properties. | | [options.writeProfile] | function | A function that will be called with the resolved Profile that should return a Promise that resolves once the profile has been written. | | [options.storageKey] | function | A key that will be used by localStorage to read/write the resolved Profile when you do not use pass in custom {@see options.readProfile} and {@see options.writeProfile} functions. |

showLogin([options])

Create a widget that allows users to obtain Sandbox credentials

Kind: global function

| Param | Type | Description | | --- | --- | --- | | [options] | Object | Customize the behaviour and appearance of the widget | | [options.mount] | HTMLElement | Indicate where the widget should be mounted. If not specified the widget will be shown as a modal dialog. | | [options.url] | String | The url of the Webtask cluster to be used. Defaults to https://webtask.it.auth0.com. | | [options.token] | String | The webtask token of the current user. If missing, and no {@see options.readProfile} profided, the SMS/email login flow will be triggered. | | [options.container] | String | The webtask container of the current user. If missing, will be derived from {@see options.token}, from the result of {@see options.readProfile}, or finally from the result of the SMS/email login flow. |

showLogs([options])

Create a widget that streams logs for a container

Kind: global function

| Param | Type | Description | | --- | --- | --- | | [options] | Object | Customize the behaviour and appearance of the widget | | [options.mount] | HTMLElement | Indicate where the widget should be mounted. If not specified the widget will be shown as a modal dialog. | | [options.url] | String | The url of the Webtask cluster to be used. Defaults to https://webtask.it.auth0.com. | | [options.token] | String | The webtask token of the current user. If missing, and no {@see options.readProfile} profided, the SMS/email login flow will be triggered. | | [options.container] | String | The webtask container of the current user. If missing, will be derived from {@see options.token}, from the result of {@see options.readProfile}, or finally from the result of the SMS/email login flow. | | [options.readProfile] | function | A function that should return a Object or a Promise for an object with url, token and container properties. | | [options.writeProfile] | function | A function that will be called with the resolved Profile that should return a Promise that resolves once the profile has been written. | | [options.storageKey] | function | A key that will be used by localStorage to read/write the resolved Profile when you do not use pass in custom {@see options.readProfile} and {@see options.writeProfile} functions. |

Build

Development workflow

git clone [email protected]:auth0/auth0-webtask-widget.git
cd auth0-webtask-widget
npm install
npm run develop

This starts webpack-dev-server at http://localhost:8080. The script will watch all dependencies and recompile on changes. Everything is served from memory with source-maps.

Production build

npm run build

This creates builds in the ./dist folder.

Two builds are created:

  1. webtask.js - Production bundle.
  2. webtask.min.js - Development bundle.

Concepts

Profile

A profile represents a user's claim to create and run webtasks on a webtask cluster as defined by sandboxjs:

Profiles are the combination of:

  1. url - The url of the webtask cluster
  2. container - The container in which the webtask will be run
  3. token - The user's webtask Token

Token

A webtask token is a JSON Web Token that encodes a user's claims to perform actions on a webtask cluster. See: the webtask documentation for details on how this works.

Webtask

A webtask is a claim to run code at a url where that code will have access to any secrets embedded in the webtask. Webtask objects expose several properties and methods.

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

Author

Auth0

License

This project is licensed under the MIT license. See the LICENSE file for more info.