Skip to content

Instantly share code, notes, and snippets.


Matias Woloski woloski

View GitHub Profile
woloski / preuserhook.js
Created Mar 29, 2019
Pre User Registration hook for Auth0 that block disposable emails
View preuserhook.js
const emailVerifier = require("verifier-node");
module.exports = function (user, context, cb) {
var response = {};
emailVerifier.verify(, context.webtask.secrets.VERIFIER_APIKEY)
.then(response => {
if (!response.valid()) return cb(new Error('Disposable email!'));
response.user = user;
woloski / contest-webtask.js
Created Nov 20, 2016
Contest Signup Webtask
View contest-webtask.js
'use latest';
import express from 'express';
import { fromExpress } from 'webtask-tools';
import bodyParser from 'body-parser';
const app = express();
var jwt = require('express-jwt');
var jwtCheck = jwt({
woloski /
Created Sep 25, 2016
webtask editor

Introducing Webtask Editor

The Webtask Editor is a web based editor (and soon an Electron desktop app) to create and edit webtasks. This started as a side project but it quickly became clear that the editor would help adopt the serverless concept webtask Our goal is to reduce the time it takes to go from an idea => code => HTTPS endpoint.

The Power of WYSWYG

One of the tools many of us enjoyed using a lot in the old days was the SQL Explorer. The instant feedback you've got when executing queries was great. Edit your query, CTRL+R, see the result, teak the query, CTRL+R, and repeat that loop until you got it right.

woloski /
Last active Sep 1, 2016
Client Credentials Rules in Auth0

This is preliminary feature to add rules into the Client Credentials exchange pipeline (i.e. exchange a client_id and secret for an access_token).

To create a rule that runs on the client credentials exchange you have to use the webtask CLI (wt). To install the CLI, you can follow the steps here:

Assuming you have an API defined with scopes ( and you created a non-interactive client ( and authorized it to use that API, follow these steps to create a rule.

Currenlt you can create only one rule that will be executed for all clients and APIs.

  1. The first step is to create the webtask rule. Create a file myrule.js and enter the following. This is an example rule that will add an arbitrary claim ( to the access_token and will also add an extra scope to the default scopes configured on the API (https://
woloski /
Created Aug 29, 2016
functions registry

Public Functions

I will create a hello world function:

echo "module.exports = function(ctx, cb) { cb(null, 'hello'); }" > hello.js
wt create hello.js
  1. Install the Custom Social Connections extension
  2. Click on the Slack button to install the Slack connection
  3. Enter a Slack Client ID and Secret. To get those go to: Fill the fields and pay special attention to the Redirect URI. Enter: See screenshots below.
  4. Click on App Credentials on the left and copy the Client ID and Client Secret and paste them on the Auth0 dashboard
  5. Click Save and then try the flow using the Try button. You should get back the full profile from Slack, including email, team and avatars.

Note: you can change the scopes on the Scope field on Auth0 and include any of these:

You can now use the Slack connection using any Auth0 client library. Example:

woloski / payment.html
Last active Oct 1, 2020
Stripe Checkout + webtask
View payment.html
<button class="pay">Pay</button>
<script src="">
var handler = StripeCheckout.configure({
image: 'https://yourlogo.png',
locale: 'auto',
token: function(token) {
$('.pay').prop("disabled", true);
woloski / runscope vs
Last active Oct 3, 2015
Runscope vs Node+Mocha
View runscope vs

This is a comparison of two testing approaches: Runscope service and pure Node.js coding. Written by Hernan Meydac Jean (@VerlicRedclaw)


This service provides a simple to use editor to create API tests with no effort.


  • Nice postman-like editor to create API tests.
  • Lots of configurable options, initial variables, shared settings, conditionals, etc.
  • Uses Chai.js as the Assertion library for responses
woloski /
Last active Sep 13, 2016
webtask + auth0
wt create webtask.js --auth0

When browsing the webtask URL, the user will get a page with Lock. Once logged in, the result of the webtask will be shown.

woloski /
Created May 16, 2015
top 100 packages from heroku distiled for webtask
  • bcrypt: A bcrypt library for NodeJS.
  • pg: PostgreSQL client - pure javascript & libpq with the same API
  • q: A library for promises (CommonJS/Promises/A,B,D)
  • node-uuid: Rigorous implementation of RFC4122 (v1 and v4) UUIDs.
  • optimist: Light-weight option parsing with an argv hash. No optstrings attached.
  • aws-sdk: AWS SDK for JavaScript
  • validator: String validation and sanitization
  • cheerio: Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • knox: Amazon S3 client
  • consolidate: Template engine consolidation library