0.0.12 • Published 3 years ago

@ralphilius/askrift v0.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

A small utilities library to make it easier to handle webhooks from popular subscription services

Áskrift means subscription in Icelandic

npm install @ralphilius/askrift # or yarn add @ralphilius/askrift

Use on your server

Example using Vercel/NextJS serverless function

import Askrift from '@ralphilius/askrift'

module.exports = (req, res) => {
  const askrift = Askrift.initialize("paddle", req.body);
  if(askrift.validRequest()){
    if(askrift.validPayload()){
      askrift.onSubscriptionCreated().then(subscription => {
        // Handle subscription_created event
      })
    // Handle other events
    } else {
      // Invalid body, possibly leak of webhooks URL?
      res.status(403).end();
    }
  } else {
    res.status(400).end();
  }
}

Supported Services

  • Paddle
  • Stripe (Coming soon)
  • Gumroad (Coming soon)
0.0.11

3 years ago

0.0.12

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.3

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago