# passport-hitsend-dev

> OAuth2 authentication strategy for HitSend

Latest version **1.0.1** (published 2023-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install passport-hitsend-dev
pnpm add passport-hitsend-dev
yarn add passport-hitsend-dev
bun add passport-hitsend-dev
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-10-04 |
| First published | 2023-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gary Dickerson |
| Maintainers | gary_hitsend_io |
| Keywords | hitsend, passport, auth, authentication |

## Links

- npm: https://www.npmjs.com/package/passport-hitsend-dev
- npm.io page: https://npm.io/package/passport-hitsend-dev

## Dependencies (1)

- [passport-oauth2](https://npm.io/package/passport-oauth2.md) ^1.7.0

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-10-04
- 1.0.0 — 2023-10-04

## README

# Passport-HitSend

[Passport](http://passportjs.org/) strategy for authenticating with [HitSend](http://www.hitsend.io/)
using the OAuth 2.0 API.

This module lets you authenticate using HitSend in your Node.js applications.
By plugging into Passport, HitSend authentication can be easily and
unobtrusively integrated into any application or framework that supports
[Connect](http://www.senchalabs.org/connect/)-style middleware, including
[Express](http://expressjs.com/).

## Usage

#### Configure Strategy

The HitSend authentication strategy authenticates users using a HitSend
account and OAuth 2.0 tokens.  The strategy requires a `verify` callback, which
accepts these credentials and calls `done` providing a user, as well as
`options` specifying a app ID, app secret, and callback URL.

    const passport = require('passport');
    const HitSendStrategy = require('passport-hitsend').Stratey;

    passport.use(new HitSendStrategy({
        clientID: HitSend_APP_ID,
        callbackURL: "http://localhost:3000/auth/HitSend/callback"
      }, function (accessToken, refreshToken, profile, done) {
        User.findOrCreate({ HitSendId: HitSend.id }, function(err, user) {
          return done(err, user);
        };
      })
    );

#### Authenticate Requests

Use `passport.authenticate()`, specifying the `'HitSend'` strategy, to
authenticate requests.

For example, as route middleware in an [Express](http://expressjs.com/)
application:

    app.get('/auth/HitSend', passport.authenticate('HitSendStrategy'));

    app.get('/auth/HitSend/callback',
      passport.authenticate('HitSendStrategy', { failureRedirect: '/login' }),
      function(req, res) {
        // Successul authentication, redirect home.
        res.redirect('/');
      });

## Credits

Created by [Gary Dickerson](http://github.com/gadicker)

Code based on passport-mailchimp by [Brian Falk](http://github.com/brainflake)

## License

[The MIT License](http://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/passport-hitsend-dev · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
