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 🙏

© 2026 – Pkg Stats / Ryan Hefner

passport-lately-sample

v1.0.2

Published

OAuth2 sample for Lately

Readme

Passport-lately-sample

This is a simple web application demonstrating Passport authentication against Lately and invocation of passport protected API's.

Requirements

  • Recent versions of node.js and npm

Install

  • Create a directory for the installation and cd to that directory
  • Obtain the sample app: npm install lately-passport-example
  • Install all nodejs modules: npm install

Usage

Create Application in Lately and configure client

  • If you don't already have one, signup for a Lately account on https://www.trylately.com; this will be the user account by which you administer your application definitions.
  • Send an email to [email protected] with your Lately username and one or more github usernames for your developers; we'll enable Applications integration for you in Lately and add the git users to the sample repo.
  • Sign-in to your Lately account and navigate to the Application page via the User menu (hover your user avatar at top right and select Applications)
  • Create an Application record for the sample app with any name, but specify the callback url http://localhost:8080/auth/lately/callback to match the sample app listen route. Save the record, and make note of the clientID and secret for your app in the list.
  • Obtain the sample application using git clone https://github.com/TryLately/passport-lately-sample , this will create a directory named passport-lately-sample. Change to that directory and run npm install to install dependencies.
  • Copy your clientID and secret from step 4 to the ./config.js file in the sample app.

Running the App

  • In the installation directory run node app.js
  • Open the sample app in a brower at http://localhost:8080 and select Login to authenticate against Lately; then allow the requested permissions to grant your Application access to our api's.
  • After login the sample app displays the user profile, which includes the Dashboards and Campaigns they have access to. You will also see a Generate option in the sample app - this links to a simple wizard that will guide you through content generation by selecting a Dashboard, Campaign and URL for the content source.

API Invocation

  • Lately authentiation returns an access token which must be provided as an Authorization header to access server API's.
   headers: {'Authorization': 'Bearer <accessToken>'}

Available Apis:

Fetch User Profile

  • Includes the Dashboards and Campaigns the logged in user has permission to post to.

GET <lately server>/v1/apps/user/profile

{
  "id": "1",
  "name": "Bob Smith",
  "provider": "Lately",  
  _json: {
    "dashboards": [{
    	_id:"d1",
    	"name":"Dashboard1",
    	"campaigns":[{
  	  	  "_id":"c1",
  	  	  "name":"Dashboard1-Campaign1",
  	  	  "shortName":"Campaign1"
    	  },{
    	  	"_id":"c2",
  	  	  "name":"Dashboard1-Campaign2",
  	  	  "shortName":"Campaign2"
    	  }
    	]
    }]
  }
}

Generate Content

  • Generate Content from url to Dashboard & Campaign:

POST <lately server>/v1/apps/content/generate

  • Sample Body Parameters
{ dashboardId: '5b1009fa580fc1118c108d0f',
  campaignId: '5b1009fb580fc1118c108d12',
  url: 'https://venturebeat.com/2018/08/22/ibm-ai-transparency-factsheets/' }
  • Sample Response

200 {"status":"success","generated":30}

License

The MIT License

Copyright (c) 2018 Lately Inc. <https://trylately.com>