Simple APIs to help your users vote


stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
Minified + gzip package size for @helpusersvote/election-logic in KB



JavaScript functions to check if a call-to-action should be rendered


First, add the module to your codebase:

npm install --save @helpusersvote/election-logic


In your app, import functions from the @helpusersvote/election-logic module:

import { shouldShowCTA } from '@helpusersvote/election-logic'

// Optional `regions` configuration, defaults to USA
const regions = [
  'city:San Francisco',

// wherever you want to render the call-to-action
if (shouldShowCTA({ regions })) {
  // render a custom banner or use `@helpuservote/election-copy`


All modules are open-sourced under the MIT License

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.