npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pofsis/eh-cta

v1.0.5

Published

EH Culture CTA label text for personal and business surfaces.

Readme

@pofsis/eh-cta

EH Culture CTA label text for personal and business surfaces. This package returns button label strings only — it does not render UI components.

What This Package Does

@pofsis/eh-cta provides a single function, getEHCTA(), that returns the correct call-to-action (CTA) label based on:

  • CTA type — e.g. submit, save, continue
  • Surface — personal or business
  • Persona — EH growth personas (undesirable, ordinary, potential, extraordinary, heroic)
  • Purpose — context such as form, profile, approval
  • Subscription — business tier (free, starter, growth, enterprise)

All parameters are passed on one options object. Use the exported constants for each value.

EH Culture Behind the CTA System

EH Culture practices "Do again" instead of "Try again." CTAs should encourage growth, ownership, excellence, and impact — even when the persona is undesirable.

The word undesirable is kept because it has internal meaning within EH Culture. Wording should remain positive and growth-oriented, never discouraging.

Labels are exact full strings stored in nested data paths. Each path resolves to the CTA type's default label from src/data/defaults.js — persona, purpose, and subscription select the path but the label text is defined per CTA type.

Installation

npm install @pofsis/eh-cta

Import

import {
  getEHCTA,
  CTA_TYPES,
  EH_PERSONAS,
  SURFACES,
  BUSINESS_SUBSCRIPTIONS,
  CTA_PURPOSES,
} from "@pofsis/eh-cta";

Basic Submit Button Example

import { getEHCTA, CTA_TYPES, EH_PERSONAS, CTA_PURPOSES } from "@pofsis/eh-cta";

function SubmitButton() {
  const buttonText = getEHCTA({
    ctaType: CTA_TYPES.SUBMIT,
    persona: EH_PERSONAS.POTENTIAL,
    purpose: CTA_PURPOSES.FORM,
  });

  return (
    <button type="submit">
      {buttonText}
    </button>
  );
}

Expected button label: Submit

Personal CTA Example

Personal CTAs resolve by CTA type + persona + purpose.

getEHCTA({
  ctaType: CTA_TYPES.SUBMIT,
  surface: SURFACES.PERSONAL,
  persona: EH_PERSONAS.POTENTIAL,
  purpose: CTA_PURPOSES.FORM,
});
// Returns: "Submit"
import { getEHCTA, CTA_TYPES, EH_PERSONAS, SURFACES, CTA_PURPOSES } from "@pofsis/eh-cta";

function PersonalSubmitButton() {
  const buttonText = getEHCTA({
    ctaType: CTA_TYPES.SUBMIT,
    surface: SURFACES.PERSONAL,
    persona: EH_PERSONAS.POTENTIAL,
    purpose: CTA_PURPOSES.FORM,
  });

  return <button type="submit">{buttonText}</button>;
}

Business CTA Example

Business CTAs resolve by CTA type + subscription + persona + purpose.

getEHCTA({
  ctaType: CTA_TYPES.SUBMIT,
  surface: SURFACES.BUSINESS,
  subscription: BUSINESS_SUBSCRIPTIONS.GROWTH,
  persona: EH_PERSONAS.HEROIC,
  purpose: CTA_PURPOSES.APPROVAL,
});
// Returns: "Submit"
import {
  getEHCTA,
  CTA_TYPES,
  EH_PERSONAS,
  SURFACES,
  BUSINESS_SUBSCRIPTIONS,
  CTA_PURPOSES,
} from "@pofsis/eh-cta";

function BusinessSubmitButton() {
  const buttonText = getEHCTA({
    ctaType: CTA_TYPES.SUBMIT,
    surface: SURFACES.BUSINESS,
    subscription: BUSINESS_SUBSCRIPTIONS.GROWTH,
    persona: EH_PERSONAS.HEROIC,
    purpose: CTA_PURPOSES.APPROVAL,
  });

  return (
    <button type="submit">
      {buttonText}
    </button>
  );
}

Expected button label: Submit

Exported Constants

Use constants instead of typing raw strings:

| Export | Example keys | |--------|----------------| | SURFACES | PERSONAL, BUSINESS | | EH_PERSONAS | UNDESIRABLE, ORDINARY, POTENTIAL, EXTRAORDINARY, HEROIC | | BUSINESS_SUBSCRIPTIONS | FREE, STARTER, GROWTH, ENTERPRISE | | CTA_PURPOSES | DEFAULT, FORM, PROFILE, REPORT, REVIEW, APPROVAL, ONBOARDING, DASHBOARD | | CTA_TYPES | SUBMIT, SAVE, CONTINUE, START, UPDATE, and all keys from the default CTA list |

Fallback Behavior

getEHCTA() is safe and never throws. It always returns a string.

  1. If only ctaType is passed, return the default CTA text.
  2. If persona is missing, use ordinary.
  3. If surface is missing, use personal.
  4. If purpose is missing, use default.
  5. If business subscription is missing, use free.
  6. If a specific persona, purpose, subscription, or surface does not exist, use the closest default.
  7. If the CTA type is not in the known list (defaults.js / CTA_TYPES), return "CTA not found".
  8. Never return undefined.
  9. Always return a safe string.
getEHCTA({ ctaType: "archiveMessage" });
// "CTA not found"

getEHCTA({ ctaType: "ksljdhf" });
// "CTA not found"

How Labels Are Stored

Labels are exact full strings stored in nested data paths:

  • Personal: ctaType → persona → purpose → label
  • Business: ctaType → subscription → persona → purpose → label

| File | Role | |------|------| | src/data/defaults.js | Flat fallback labels for unknown paths | | src/data/labels/personal.js | Full personal label tree | | src/data/labels/business.js | Full business label tree |

Updating CTA Values Later

Edit the exact label string at the path you want to change. By default, every path for a CTA type uses the same label from src/data/defaults.js.

Personal example — edit src/data/labels/personal.js:

getStarted: {
  ordinary: {
    default: "Get Started",
    form: "Get Started",
    profile: "Get Started",
    // all purposes use the same cta type label
  },
},

Business example — edit src/data/labels/business.js:

submit: {
  growth: {
    heroic: {
      default: "Submit",
      approval: "Submit",
      // all purposes use the same cta type label
    },
  },
},

Frontend code stays the same:

getEHCTA({
  ctaType: CTA_TYPES.SUBMIT,
  surface: SURFACES.BUSINESS,
  subscription: BUSINESS_SUBSCRIPTIONS.GROWTH,
  persona: EH_PERSONAS.HEROIC,
  purpose: CTA_PURPOSES.APPROVAL,
});

This Package Does Not Create Buttons

@pofsis/eh-cta only returns CTA text strings. Use the result inside any button component in your frontend framework (React, Vue, Angular, plain HTML, etc.).

Development

Run tests:

npm test