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

button-fields-app

v1.1.2

Published

This Twenty CRM app allows users to add configurable button fields to any custom object. Buttons can be configured with custom labels, actions (links or JavaScript functions), and various styling options.

Downloads

635

Readme

Button Fields App for Twenty CRM

This Twenty CRM app allows users to add configurable button fields to any custom object. Buttons can be configured with custom labels, actions (links or JavaScript functions), and various styling options.

Features

  • Configurable Actions: Buttons can either open links or execute JavaScript code
  • Flexible Styling: Choose from primary, secondary, or tertiary variants and small/medium sizes
  • Link Options: Links can open in the same tab or a new tab
  • JavaScript Sandboxing: JavaScript actions run in a controlled environment with limited scope
  • Admin Interface: Easy-to-use interface for managing button fields on objects
  • Record Context: JavaScript actions have access to the current record ID

Installation

  1. Install the app in your Twenty workspace:

    npx twenty app install /path/to/button-fields-app.tgz
  2. The app will be available in your workspace under Settings > Apps

Usage

Adding Button Fields

  1. Open the Button Fields Manager from the command menu (search for "Button Fields")
  2. Enter the Object ID of the object you want to add button fields to
  3. Click "Load Button Fields" to see existing buttons
  4. Use the "Add New Button Field" form to create a new button

Button Configuration Options

  • Button Label: The text displayed on the button
  • Action Type:
    • Link: Opens a URL when clicked
    • JavaScript: Executes custom JavaScript code
  • Action Value:
    • For links: URL (use {recordId} placeholder for current record ID)
    • For JavaScript: Function code that receives (recordId, console) parameters
  • Button Variant: Primary, Secondary, or Tertiary styling
  • Button Size: Small or Medium
  • Open in New Tab: Only available for link actions

JavaScript Actions

JavaScript actions run in a sandboxed environment with access to:

  • recordId: The ID of the current record
  • console: Limited console methods (log, warn, error)

Example JavaScript action:

function(recordId, console) {
  console.log("Button clicked for record:", recordId);
  // Your custom logic here
}

Viewing Buttons

Once added, button fields appear in:

  • Table views (list of records)
  • Record detail pages
  • Any view that displays the object's fields

API Endpoints

The app provides the following HTTP endpoints:

  • POST /s/button-fields/add-button-field - Add a new button field
  • GET /s/button-fields/get-button-fields/:objectId - Get button fields for an object
  • PUT /s/button-fields/update-button-field - Update an existing button field
  • DELETE /s/button-fields/delete-button-field - Delete a button field

Security Considerations

  • JavaScript actions are sandboxed and cannot access the full DOM or execute dangerous operations
  • Link actions are validated as URLs to prevent malicious redirects
  • All API endpoints require authentication
  • Button actions are executed with the app's permission scope

Development

Building

npm run build

Testing

npm test

Local Development

npm run dev

Contributing

This app follows Twenty's development guidelines and coding standards. Please ensure:

  • All code is TypeScript with proper typing
  • Components follow React best practices
  • Tests are included for new functionality
  • Security considerations are addressed

License

This app is part of the Twenty CRM open-source project.