1.0.1 • Published 2 years ago

vscode-beggar v1.0.1

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

VSCode Beggar

A little utility for asking for money in a VSCode extension.

Install

npm install --save vscode-beggar

Usage

Just do the following and this utility will handle the rest. It will prompt users once, usually a couple of minutes after your extension has been initialized for the second time.

import beggar from 'vscode-beggar';

beggar ({
  id: 'your-extensions-id', // Your unique extension identifier
  title: '[Extension Name] Would you like to say thanks with dollars?', // The question to put in the dialog
  url: 'https://buy.stripe.com/4gweWHcsh71lbN6dQQ', // The URL to open when the user wants to donate
  actions: {
    yes: {
      title: 'Donate now', // Optional title for the "yes" action
      webhook: 'https://telemetry.example.com/1' // Optional telemetry endpoint to query when the user says yes
    },
    no: {
      title: 'Thanks, but I never pay for software', // Optional title for the "no" action
      webhook: 'https://telemetry.example.com/0' // Optional telemetry endpoint to query when the user says no
    },
    cancel: {
      webhook: 'https://telemetry.example.com/2' // Optional telemetry endpoint to query when the dialog is just dismissed
    }
  }
});

Set the following setting to disable prompts entirely:

{
  "donations.disablePrompt": true
}

License

MIT © Fabio Spampinato