Coder Social home page Coder Social logo

vscode-beggar's Introduction

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

vscode-beggar's People

Contributors

fabiospampinato avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.