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

apollo-accounts-server

v0.0.1

Published

[![CircleCI](https://circleci.com/gh/TimMikeladze/apollo-accounts-server.svg?style=svg)](https://circleci.com/gh/TimMikeladze/apollo-accounts-server)

Downloads

2

Readme

Accounts for Apollo Server

CircleCI

Install

npm i -S apollo-accounts-server
npm i -S apollo-accounts-knexjs # If you're using Postgres, MSSQL, MySQL, MariaDB, SQLite3, or Oracle
npm i -S apollo-accounts-mongoose # If you're using Mongo

Examples

Express

Supported databases

You'll need to install a package based on the type of database you're using. This package defines a schema and implements functions for reading and writing user account data.

npm i -S apollo-accounts-knexjs # For SQL
npm i -S apollo-accounts-mongoose # For Mongo

Configuration

Underneath the covers apollo-accounts-server uses Grant to handle signing in with different providers. It also adopts Grant's configuration and builds upon it with apollo-accounts-server specific options.

  • server - configuration about your server
    • redirectTo - route to redirect to on login
    • loginWith - methods with which the user can login with, defaults to ['username', 'email'],
    • signupWith - methods with which the user can sign up with, defaults to ['username', 'email'],
    • protocol - either http or https
    • host - your server's host name localhost:3000 | dummy.com:5000 | mysite.com ...
    • path - path prefix to use for the Grant middleware (defaults to empty string if omitted)
    • callback - common callback for all providers in your config /callback | /done ...
    • transport - transport to use to deliver the response data in your final callback querystring | session (defaults to querystring if omitted)
    • state - generate random state string on each authorization attempt true | false (OAuth2 only, defaults to false if omitted)
  • provider1 - any of Grant's supported provider facebook | twitter ...
    • extract - A function which fetches a unique identifier, username, and optionally a profile from the provider. It receives two arguments, an accessToken string and the provider object containing the provider's configuration. It must return an object with keys identifier, username, and optionally profile.
    • key - consumer_key or client_id of your app
    • secret - consumer_secret or client_secret of your app
    • scope - array of OAuth scopes to request
    • callback - specific callback to use for this provider (overrides the global one specified under the server key)
    • custom_params - custom authorization parameters (see the [Custom Parameters][custom-parameters] section)
const config = {
  server: {
    secret: 'terrible secret',
    redirectTo: '/home',
  },
  github: {
    key: 'client key from github',
    secret: 'client secret from github',
  },
};

How this package works