"Load more" button for apps in the Volt framework.
Merb_helpers_monkey is a Merb plug-in to extend the followng helper methods defined in merb-helpers: * radio_button() - to take boolean value as :checked option. * field_for(), form_for(), fieldset_for() - to take new :index_by option.
A nice way to scaffold that includes autocomplete search field with categories and a Load More button that simulates endless page. Requires: jQuery, jQueryUI
Rails plugin to use Intuit's Official QuickBooks Online Buttons in SVG format.
icic is a command line interface to automate creation of image asset for ios and android from single image file. This tool depend on ImageMagick / GraphicsMagic, please read on github (by clicking github star button) for more info.
OmniAuth strategy for Money Button
...he sat at his desk in room 427 and he pushed buttons on a keyboard.
Select tag using radio buttons, with provision for typing in custom "Other" value. Requires jQuery and Bootstrap 3.x
Prevent users sending duplicate requests by rapidly clicking links and buttons.
Helper for add social share feature in your Rails app. Twitter, Facebook, Vkontakte, Odnoklassniki, WhatsApp, Viber
Helper for add social share feature in your Rails app. Twitter, Facebook, Weibo, Douban, QQ, Tumblr ...
Implementation of view helper methods that utilize robust options and traits to generate semantic Bootstrap4 HTML for Ruby on Rails. Supply themes, rails helper options (such as :method and :confirm for a `link_to`). Example usage: `<%= ui.bootstrap :button, :primary, :block, href: user_path(@user), method: :delete, confirm: 'Are you sure?', tooltip: 'Adds a new user' %>` Which outputs a primary button with `btn-block` that uses rails method & confirm, and automatically supplies a tooltip (and there's much more!)
SASS Mixins for generate beautiful buttons
A button_to helper that can be used inside a form tag (unlike Rails's own button_to)
Adds social sharing buttons to video.js for Facebook and Twitter.
a sassified and gem packaged version if css3 github buttons
Designed for using morsecode on the Raspberry Pi with a keypad which has 4 buttons (dash, dot, separator, and send).
Rails engine that checks for pending migrations and presents an error screen that allows you to manage your migrations.
ActionView helpers for creating NAVER LINE share buttons.
LINE Send button helper
Kanso - Semantic Flat Buttons integration with Rails and Asset Pipeline
angular-clipboard.js Copy text to clipboard by clicking a button, without using Flash
Helper for add social share feature in your Rails app. Twitter, Facebook, Weibo, Douban, QQ ...
The material design effect ripple in angular way, can be used on any button.
This gem provides an interface to access Novation's LaunchPad programmatically. LEDs can be lighted and button presses can be evaluated using launchpad's MIDI input/output.
This gem provides programmatic access to the Novation Launchpad MK2. LEDs can be lighted and button presses can be evaluated using launchpad's MIDI input/output.
Zocial Buttons support a lot of social icons. This gem is used for seamless integration of those icons.
Some common functions for Bootstrap tables and buttons.
Add social payments to your business by adding a ‘Pay with Pygg’ button to your site!
Render Kakao, NAVER, Apple and Google buttons with HTML identical to the companion npm package.
Render one button per event the current user may perform on a record, each POSTing to a member transition route that re-authorizes server-side. Pluggable state machine and authorization backends; ships with state_machines and ActionPolicy.
Reads a text file (if supplied as the first argument) and creates a pdf file with the same name but with .pdf as extension in the current directory via the program pdflatex (the only requirement besides ruby itself). If '-h' is the first argument, then the program displays the helptext and exits. The program can also read the input text from STDIN (STanDard IN) and create the pdf file in the user's home directory. When this method is used, no argument is given to the program and the text is simply piped directly into the program like this: $ echo 'Hello' | txt2pdf This would create a pdf file with only 'Hello' and the page number at the bottom of the resulting pdf page. With this, you could map a key binding in your window manager to create a pdf file from the text you selected in any program, be it the terminal, your browser or your text editor. In my wm of choice, i3, I have added the following to my i3 config: bindsym $mod+p exec xclip -o | txt2pdf This would create a pdf file from the text I have selected as I hit the 'Window Button' and 'p'.
CARIN IG for Blue Button® Test Kit
# Wuffl <strong> 1. Introduction </strong> Wuffl is a simple image viewer which can move pictures either to a „Selected“ folder or to a „Deleted“ folder. "Selected" and "Deleted" folders are located in the same folder as the chosen picture. Wuffl is available for Linux Ubuntu >=14.04, Mac >= OS Ventura and Windows >=10. Imagine you review you vacation photographs and you need to select which pictures to show to your friends at the next party, or you work your way through a bunch of old pictures and you need to select a view of them for a anniversary celebration. Wuffl allows you to move the picture to an extra folder ("Selected") or to a "Deleted" folder while viewing it. <strong> 2. Installation </strong> To use the Wuffl image viewer you require: <ul> <li> <a href="https://www.ruby-lang.org/en/downloads/"><code>ruby</code></a> (v2.4) </ul> as well as the following Ruby gems: <ul> <li><code>fastimage</code> <li><code>fileutils</code> <li><code>gtk3</code> <li><code>stringio</code></li> </ul> Get the Wullf image viewer by typing ```gem install wuffl``` in your command line. This will install the wuffl gem as well as the gems mentined above. <strong>3. Usage</strong> Using your terminal or cmd start Wuffl by typing <code> wuffl</code> After starting Wuffl you'll see a start screen with a line of buttons at the bottom. To select an image go to the top left corner, klick on <code>File</code> → <code>Open file</code> and browse to the location of you images. Then select an image and click <code>open</code> or just doubleclick on the selected image. <strong>4. Remarks</strong> If you have any remarks, bugs, questions etc. please tell me, I'd be happy to help.
This gem was created for a presentation around Sass
RubyEverywhere gives a Rails (or Sinatra, or Hanami) app a native life on desktop, iOS, and Android. Desktop is a Tauri shell — in local mode the whole app is pressed into a single-file binary with Tebako and runs on-device with no Ruby install; in remote mode the shell wraps your deployed app. iOS and Android are Hotwire Native shells with a real tab bar, nav-bar buttons, menus, notifications, haptics, biometrics, and deep links. One config file, one CLI, one JavaScript bridge, with the web app staying the source of truth.
OzdenUI for Ruby opens a window of its own whose objects are the objects of basic.js and the 80+ components of the OzdenUI kit (buttons, fields, lists, tables, charts, dialogs, editors), written in Ruby with blocks. On macOS the window is the web view of the system, made with the fiddle library of Ruby; on Windows and Linux it is an app window of Edge or Chrome. No other gem and no compiler are needed; it also works with the Ruby that comes with macOS.
Text fields, text areas, a rich text area (Tiptap), check boxes, radio buttons, selects, a combobox, ratings, scales, color and file fields, a submit button and nested forms as view components, with their Stimulus controllers and styles, in a Rails engine.
runsheets turns a directory of markdown files into an executable runbook served from a local web page. Fenced code blocks the author marks as runnable get a Run button; every execution, its output, exit status and timing, and every operator acknowledgement is captured in order into a run record (the runsheet). The tool binds to loopback only, executes only blocks that opt in, and modifies nothing in the runbook directory.
A view helper for a button that opens a lazily loaded Turbo Frame in a native popover, anchored to the button with CSS. No JavaScript of its own.
Control a Raspberry Pi's hardware from Ruby. GPIO goes through libgpiod v2 — the Linux GPIO character device (uAPI v2) — rather than the deprecated sysfs interface. PWM is either the hardware peripheral through sysfs or timed in Ruby on any line; I2C and SPI are ioctl calls on /dev/i2c-N and /dev/spidev, needing no libgpiod at all. On top sits a gpiozero-style device layer: LED, Button, Motor, PWMLED, RGBLED, Servo, RotaryEncoder, and drivers for the ADT7410 temperature sensor, ST7032 character LCD, MCP3208 ADC, ILI9341 colour TFT and XPT2046 touch panel. Bound through the stdlib `fiddle`, which is built with the interpreter and so matches any Pi's architecture, unlike the precompiled `ffi` gem.
plan_driven runs a Rails team's delivery process inside your Rails app, from a browser wizard or the command line: every button in the wizard runs the same plan-driven command. A short interview turns an idea into an implementation plan grounded in your real schema; the plan is checked by guards written in Ruby, rendered to PDF and approved. Approved plans become tickets, each ticket is handed to a Cursor cloud agent that opens a pull request, and only pull requests you approve are merged. Acceptance criteria map to Cucumber scenarios, and every phase leaves documentation behind: the plan, the tickets, the pull requests and a delivery report.
Ask an AI coding agent to move a button 10 pixels left, and watch it struggle. CSS gives it five or six different ways to control position: margin, padding, a flex order, a grid column, a transform. Nothing says which one is actually in charge on this particular page, so the agent guesses, edits the wrong one, and something else quietly shifts. It reports the change as done. The page is now broken. QSS removes the guessing by removing the choice. Every element's position and size is one explicit number, not a tug-of-war between properties. Those numbers are written in a single unit, a "qnt" (1/1000th of the layout's own width), so the same edit holds its exact proportion at any screen size -- a phone, a laptop, a 4K display -- with no breakpoints, no media queries, and no separate rules to keep in sync. Move something once and it stays put, everywhere. That is the whole idea, and it helps humans exactly as much as it helps agents: fewer rules to maintain, one obvious place to make a change, and layouts that stay consistent across devices by construction instead of by discipline. QSS backs that up with two automatic auditors that catch mistakes a human reviewer might miss (a RED finding is a broken rule, ORANGE is a judgment call) and a real-browser render check, because a passing lint rule is not proof a page actually displays correctly -- only watching it render is. It ships compiled, ready-to-use CSS plus its SCSS source, works with zero JavaScript, and offers an optional JS engine for a few conveniences on top. It stays out of the way of whatever you use for colors, type and visual polish (Tailwind or anything else) -- QSS only ever owns position, size and structure. QSS was extracted from a real Rails development tool that still runs on it today, not built as a theoretical exercise. See docs/HOWTO.md to get started and docs/DESIGN_HISTORY.md for the full story of what was tried, what broke, and why each decision landed where it did. Status: 0.x. Expect names and APIs to change before 1.0.
== Confidently Build Terminal Apps Rooibos[https://rooibos.run] helps you build interactive terminal applications. Keep your code understandable and testable as it scales. Rooibos handles keyboard, mouse, and async work so you can focus on behavior and user experience. gem install rooibos <i>Currently in beta. APIs may change before 1.0.</i> === Get Started in Seconds rooibos new my_app cd my_app rooibos run That's it. You have a working app with keyboard navigation, mouse support, and clickable buttons. Open <tt>lib/my_app.rb</tt> to make it your own. --- === The Pattern \Rooibos uses Model-View-Update, the architecture behind Elm[https://guide.elm-lang.org/architecture/], Redux[https://redux.js.org/], and {Bubble Tea}[https://github.com/charmbracelet/bubbletea]. State lives in one place. Updates flow in one direction. The runtime handles rendering and runs background work for you. --- === Hello, MVU The simplest \Rooibos app. Press any key to increment the counter. Press <tt>Ctrl</tt>+<tt>C</tt> to quit. require "rooibos" module Counter # Init: How do you create the initial model? Init = -> { 0 } # View: What does the user see? View = -> (model, tui) { tui.paragraph(text: <<~END) } Current count: #{model}. Press any key to increment. Press Ctrl+C to quit. END # Update: What happens when things change? Update = -> (message, model) { if message.ctrl_c? Rooibos::Command.exit elsif message.key? model + 1 end } end Rooibos.run(Counter) That's the whole pattern: Model holds state, Init creates it, View renders it, and Update changes it. The runtime handles everything else. --- === Your First Real Application A file browser in sixty lines. It opens files, navigates directories, handles errors, styles directories and hidden files differently, and supports vim-style keyboard shortcuts. If you can do this much with this little code, imagine how easy _your_ app will be to build. require "rooibos" module FileBrowser # Model: What state does your app need? Model = Data.define(:path, :entries, :selected, :error) Init = -> { path = Dir.pwd entries = Entries[path] Ractor.make_shareable( # Ensures thread safety Model.new(path:, entries:, selected: entries.first, error: nil)) } View = -> (model, tui) { tui.block( titles: [model.error || model.path, { content: KEYS, position: :bottom, alignment: :right}], borders: [:all], border_style: if model.error then tui.style(fg: :red) else nil end, children: [tui.list(items: model.entries.map(&ListItem[model, tui]), selected_index: model.entries.index(model.selected), highlight_symbol: "", highlight_style: tui.style(modifiers: [:reversed]))] ) } Update = -> (message, model) { return model.with(error: ERROR) if message.error? model = model.with(error: nil) if model.error && message.key? if message.ctrl_c? || message.q? then Rooibos::Command.exit elsif message.home? || message.g? then model.with(selected: model.entries.first) elsif message.end? || message.G? then model.with(selected: model.entries.last) elsif message.up_arrow? || message.k? then Select[:-, model] elsif message.down_arrow? || message.j? then Select[:+, model] elsif message.enter? then Open[model] elsif message.escape? then Navigate[File.dirname(model.path), model] end } private # Lines below this are implementation details KEYS = "↑/↓/Home/End: Select | Enter: Open | Esc: Navigate Up | q: Quit" ERROR = "Sorry, opening the selected file failed." ListItem = -> (model, tui) { -> (name) { modifiers = name.start_with?(".") ? [:dim] : [] fg = :blue if name.end_with?("/") tui.list_item(content: name, style: tui.style(fg:, modifiers:)) } } Select = -> (operator, model) { new_index = model.entries.index(model.selected).public_send(operator, 1) model.with(selected: model.entries[new_index.clamp(0, model.entries.length - 1)]) } Open = -> (model) { full = File.join(model.path, model.selected.delete_suffix("/")) model.selected.end_with?("/") ? Navigate[full, model] : Rooibos::Command.open(full) } Navigate = -> (path, model) { entries = Entries[path] model.with(path:, entries:, selected: entries.first, error: nil) } Entries = -> (path) { Dir.children(path).map { |name| File.directory?(File.join(path, name)) ? "#{name}/" : name }.sort_by { |name| [name.end_with?("/") ? 0 : 1, name.downcase] } } end Rooibos.run(FileBrowser) --- === Batteries Included ==== Commands Applications fetch data, run shell commands, and set timers. \Rooibos Commands run off the main thread and send results back as messages. <b>HTTP requests:</b> Update = -> (message, model) { case message in :fetch_users [model.with(loading: true), Rooibos::Command.http(:get, "/api/users", :got_users)] in { type: :http, envelope: :got_users, status: 200, body: } model.with(loading: false, users: JSON.parse(body)) in { type: :http, envelope: :got_users, status: } model.with(error: "HTTP #{status}") end } <b>Shell commands:</b> Update = -> (message, model) { case message in :list_files Rooibos::Command.system("ls -la", :listed_files) in { type: :system, envelope: :listed_files, stdout:, status: 0 } model.with(files: stdout.lines.map(&:chomp)) in { type: :system, envelope: :listed_files, stderr:, status: } model.with(error: stderr) end } <b>Timers:</b> Update = -> (message, model) { case message in { type: :timer, envelope: :tick, elapsed: } [model.with(frame: model.frame + 1), Rooibos::Command.wait(1.0 / 24, :tick)] end } <b>And more!</b> \Rooibos includes <tt>all</tt>, <tt>batch</tt>, <tt>bubble</tt>, <tt>cancel</tt>, <tt>custom</tt>, <tt>deliver</tt>, <tt>exit</tt>, <tt>http</tt>, <tt>map</tt>, <tt>open</tt>, <tt>system</tt>, <tt>tick</tt>, and <tt>wait</tt> commands. You can also define your own custom commands for complex orchestration. Every command produces a message, and Update handles it the same way. ==== Testing \Rooibos makes TUIs so easy to test, you'll save more time by writing tests than by not testing. <b>Unit test Update, View, and Init.</b> No terminal needed. Test helpers included. def test_moves_selection_down_with_j model = Ractor.make_shareable(FileBrowser::Model.new( path: "/", entries: %w[bin exe lib], selected: "bin", error: nil)) message = RatatuiRuby::Event::Key.new(code: "j") result = FileBrowser::Update.call(message, model) assert_equal "exe", result.selected end <b>Style assertions.</b> Draw to a headless terminal, verify colors and modifiers. def test_directories_are_blue with_test_terminal(60, 10) do model = Ractor.make_shareable(FileBrowser::Model.new( path: "/", entries: %w[file.txt subdir/], selected: "file.txt", error: nil)) widget = FileBrowser::View.call(model, RatatuiRuby::TUI.new) RatatuiRuby.draw { |frame| frame.render_widget(widget, frame.area) } assert_blue(1, 2) # "subdir/" at column 1, row 2 end end <b>System tests.</b> Inject events, run the full app, snapshot the result. def test_selection_moves_down with_test_terminal(120, 30) do Dir.mktmpdir do |dir| FileUtils.touch(File.join(dir, "a")) FileUtils.touch(File.join(dir, "b")) FileUtils.touch(File.join(dir, "c")) inject_key(:down) inject_key(:ctrl_c) # Tests use explicit params to inject deterministic initial state. Rooibos.run( model: Ractor.make_shareable(FileBrowser::Model.new( path: dir, entries: %w[a b c], selected: "a", error: nil)), view: FileBrowser::View, update: FileBrowser::Update ) assert_snapshots("selection_moved_down") do |lines| title = "┌/tmp/test#{'─' * 107}┐" lines.map do |l| l.gsub(/┌#{Regexp.escape(dir)}[^┐]*┐/, title) end end end end end Snapshots record both plain text and ANSI colors. Normalization blocks mask dynamic content (timestamps, temp paths) for cross-platform reproducibility. Run <tt>UPDATE_SNAPSHOTS=1 rake test</tt> to regenerate baselines. ==== Scale Up Large applications decompose into fragments. Each fragment has its own Model, View, Update, and Init. Parents compose children. The pattern scales. The Router DSL eliminates boilerplate: module Dashboard include Rooibos::Router route :stats, to: StatsPanel route :network, to: NetworkPanel receive_events :ctrl_c, -> { Rooibos::Command.exit } only when: -> (_message, model) { !model.modal_open } do receive_events :q, -> { Rooibos::Command.exit } forward_events :s, to: :stats, as: :fetch forward_events :p, to: :network, as: :ping end Update = from_router # ... Model, Init, View below end Declare routes and event handlers. The router generates Update for you. Use guards to ignore messages when needed. ==== CLI The <tt>rooibos</tt> command scaffolds projects and runs applications. rooibos new my_app # Generate project structure rooibos run # Run the app in current directory Generated apps include tests, type signatures, and a working welcome screen with keyboard and mouse support. --- === The Ecosystem \Rooibos builds on RatatuiRuby[https://www.ratatui-ruby.dev], a Rubygem built on Ratatui[https://ratatui.rs]. You get native performance with the joy of Ruby. \Rooibos is one way to manage state and composition. Kit is another. ==== Rooibos[https://www.rooibos.run] Model-View-Update architecture. Inspired by Elm, Bubble Tea, and React + Redux. Your UI is a pure function of state. - Functional programming with MVU - Commands work off the main thread - Messages, not callbacks, drive updates ==== {Kit}[https://sr.ht/~kerrick/ratatui_ruby/#chapter-3-the-object-path--kit] (Coming Soon) Component-based architecture. Encapsulate state, input handling, and rendering in reusable pieces. - OOP with stateful components - Separate UI state from domain logic - Built-in focus management & click handling Both use the same widget library and rendering engine. Pick the paradigm that fits your brain. --- === Links [Get Started] {Getting Started}[https://www.rooibos.run/docs/trunk/doc/getting_started/index_md.html], {Tutorial}[https://www.rooibos.run/docs/trunk/doc/tutorial/index_md.html], {Examples}[https://www.rooibos.run/docs/trunk/examples/app_fractal_dashboard/README_md.html] [Coming From...] {React/Redux}[https://www.rooibos.run/docs/trunk/doc/getting_started/for_react_developers_md.html], {BubbleTea}[https://www.rooibos.run/docs/trunk/doc/getting_started/for_go_developers_md.html], {Textual}[https://www.rooibos.run/docs/trunk/doc/getting_started/for_python_developers_md.html] [Learn More] {Essentials}[https://www.rooibos.run/docs/trunk/doc/essentials/index_md.html], {Scaling Up}[https://www.rooibos.run/docs/trunk/doc/scaling_up/index_md.html], {Best Practices}[https://www.rooibos.run/docs/trunk/doc/best_practices/index_md.html], {Troubleshooting}[https://www.rooibos.run/docs/trunk/doc/troubleshooting/index_md.html] [Community] {Forum}[https://forum.setdef.com/c/rooibos], {Announcements}[https://forum.setdef.com/tags/c/rooibos/announcement], {Bug Tracker}[https://forum.setdef.com/tags/c/rooibos/bug], {Contribution Guide}[https://github.com/setdef/Rooibos/blob/trunk/CONTRIBUTING.md], {Code of Conduct}[https://github.com/setdef/Rooibos/blob/trunk/CODE_OF_CONDUCT.md] --- [Website] https://rooibos.run [Source] https://github.com/setdef/Rooibos [RubyGems] https://rubygems.org/gems/rooibos © 2026 Kerrick Long · Library: LGPL-3.0-or-later · Website: CC-BY-NC-ND-4.0 · Snippets: MIT-0
UI components for Rails views in the spirit of form_for. Builders for index tables (sortable, deferred, kept live by Turbo Streams), detail lists, forms, cards, page headers and loading skeletons; a Turbo Frame modal, a confirm dialog and flash toasts; menus, tabs, tooltips, local times, copy buttons, autogrowing textareas and UUID inputs as self-registering custom elements; and AI chat components — transcripts, streamed replies, tool-call timelines, plans, permission requests and a composer — kept live by Turbo Streams. Plain helpers styled with Tailwind CSS v4 (required; the host's build compiles the gem's component CSS), with no Stimulus.
A daemon that catches the moments Claude Code stops and waits on a human, and relays them to Telegram — with the question's text and reply buttons. Plus a remote for the terminal itself: list tabs, create them, send commands.
Renders clickable buttons and swatches to copy hex colors to clipboard. Automatically selects black or white text using WCAG contrast math. Includes custom SVG icons, no dependencies.
ODT UI for Ruby on Rails brings the ODT Design System directly into Rails applications with a Standalone CSS First architecture. Key Features: * Standalone CSS First: Ships pre-compiled design tokens and component styles with zero host build tools required (compatible with Propshaft, Sprockets, or no asset pipeline). * Seamless Tailwind CSS v4 Interop: Full @theme preset configuration allowing custom utility classes to merge cleanly. * Hotwire & Turbo Ready: Out-of-the-box ActionView helpers for Flash Toasts, Turbo Stream notifications, and Stimulus-powered Modals. * Complete Component Set: Buttons, Badges, Cards, Alerts, Toasts, Modals, Headings, Text, Avatars, Inputs, Selects, Checkboxes, Radios, and Form Groups. * Type Checked: Full RBS type signatures included for Ruby LSP and Solargraph autocompletion.
Adds a {% social_share %} Liquid tag that renders share buttons for Bluesky, Mastodon, Facebook, Reddit, LinkedIn, X, Threads, email, and copy-link. Icons are inline SVGs from Simple Icons (CC0). Fully configurable via _config.yml.
# 1MSG Ruby SDK Official Ruby SDK for the **1MSG WhatsApp Business API**. This document is generated from the public OpenAPI contract. It covers install, auth, quick start, and every public operation available in the client. | | | |---|---| | **RubyGems** | [`one_msg_sdk`](https://rubygems.org/gems/one_msg_sdk) | | **Source** | [github.com/1msg/1msg-sdk/ruby](https://github.com/1msg/1msg-sdk/tree/main/ruby) | | **API docs** | [docs.1msg.io](https://docs.1msg.io/) | | **Platform** | [platform.1msg.io](https://platform.1msg.io/) | | **Support** | support@1msg.io | | **OpenAPI version** | 1.0.0 | | **Operations** | 60 | | **AI agent guide** | [AGENTS.md](./AGENTS.md) | --- ## Install ```bash gem install one_msg_sdk -v 2.0.2 ``` ## Requirements | Variable | Where to get it | Example | |----------|-----------------|---------| | `baseUrl` | Platform → channel → API host | `https://api.1msg.io` | | `instanceId` | Platform → channel id | `ODI371267300` | | `token` | Platform → channel → API token | JWT or API key | Use environment variables (`MSG_API_TOKEN`, `MSG_INSTANCE_ID`). Never commit tokens. ## Quick start ```ruby require 'one_msg_sdk' OneMsgSdk.configure do |config| config.host = "https://api.1msg.io/#{ENV.fetch('MSG_INSTANCE_ID')}" end messaging = OneMsgSdk::MessagingApi.new messaging.send_message( ENV.fetch('MSG_API_TOKEN'), 'Hello from 1MSG SDK', nil, '12020721369@c.us' ) ``` ## Authentication All requests use query-token auth: ```text https://{baseUrl}/{instanceId}/{path}?token={token} ``` Pass the channel token as the first argument to generated API methods. ## Recipient addressing - `chatId`: `12020721369@c.us` (1:1) or `...@g.us` (group) - `phone`: country code + number, no `+` - Exactly one of `chatId` | `phone` per request ## 24-hour messaging window Free-form `sendMessage` only works inside the 24h customer-care window. Outside that window use `sendTemplate`. ## Client map ```ruby MessagingApi # send/list messages, media, interactive ProfileApi # getMe GroupsApi # create/list/manage groups FlowsApi # WhatsApp Flows lifecycle TemplatesApi # listTemplates ChannelApi # channel helpers CallingApi # calling WebhooksApi # webhooks ``` ## Package notes Gem name is `one_msg_sdk`. Module is `OneMsgSdk`. ## API reference API groups: calling, catalog, channel, flows, groups, messaging, profile, templates, users, webhooks. ### calling #### `getCallingSettings` Get calling settings Return WhatsApp Calling API settings for this channel (beta). Proxies upstream `GET /calling/settings`. **Prerequisites** - Number must be eligible for Meta Calling (Cloud API; not COEX) - Trial / `subscriptionBlocked` channels receive **403** plain text - You need your own WebRTC or SIP stack; 1msg is a **signaling proxy** only and does **not** store call history or recordings See the **Calling** tag overview for inbound/outbound flows and webhooks. ```yaml http: GET /callingSettings operationId: getCallingSettings clientGroup: calling responses: 200, 401, 500 ``` #### `initiateCall` Call action (connect / pre_accept / accept / reject / terminate) Perform a WhatsApp Calling action (beta). Proxies upstream `POST /calling/calls`. Despite the historical path name `/initiateCall`, this endpoint handles **all** call actions: | action | Use | Required | |--------|-----|----------| | `connect` | Outbound business → user | `to` + `session` (`sdp_type: offer`) | | `pre_accept` | Inbound (optional, reduces audio clipping) | `call_id` + `session` (`sdp_type: answer`) | | `accept` | Inbound answer | `call_id` + `session` (`sdp_type: answer`) | | `reject` | Decline inbound | `call_id` | | `terminate` | Hang up | `call_id` | **SDP / media (critical)** - `accept` / `pre_accept` require a **WebRTC-generated SDP answer**. - Do **not** send Meta's offer SDP back as the answer. - Postman (or curl) alone **cannot** establish real media — you need a WebRTC or SIP stack. 1msg only proxies signaling. Answer within ~**30–60 seconds** of an inbound `connect` webhook or Meta terminates as unanswered. Common Meta errors include Calling not enabled (`138000`), no permission (`138006`), SDP validation failures. **Outbound** requires a prior Call Permission Request (CPR) acceptance. See the **Calling** tag overview for the full outbound flow and CPR limits. Trial / `subscriptionBlocked` → **403** plain text. Upstream failures often return HTTP 200 with `{ "response": { "error": "..." } }`. ```yaml http: POST /initiateCall operationId: initiateCall clientGroup: calling responses: 200, 401, 500 ``` #### `updateCallingSettings` Update calling settings Enable, disable, or update WhatsApp Calling settings (beta). Proxies upstream `POST /calling/settings`. Body is forwarded as-is (1msg does not validate fields). **Common fields under `calling`** - `status` (`ENABLED` | `DISABLED`) — required to turn calling on/off - `call_icon_visibility` (`DEFAULT` | `DISABLE_ALL`) — optional - `callback_permission_status` (`ENABLED` | `DISABLED`) — optional; when enabled, inbound user calls grant callback permission - `call_hours` — optional hours / timezone object - `sip` — optional SIP trunk; when SIP is ENABLED, Graph call actions and calling webhooks are not used - `srtp_key_exchange_protocol` (`DTLS` | `SDES`) — SDES only with SIP - `video.status` — optional Meta may accept only one feature group per request — prefer focused updates (e.g. enable status first, then SIP). Trial / `subscriptionBlocked` → **403** plain text. ```yaml http: POST /callingSettings operationId: updateCallingSettings clientGroup: calling responses: 200, 401, 500 ``` ### catalog #### `createCommerce` Set Commerce Settings Update catalog/cart commerce settings via the `params` object. - `params.is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `params.is_cart_enabled` — enable cart (`true`) or disable it (`false`). Blocked when the channel subscription limit is exceeded. Requires a commerce-capable channel (Cloud Functions `/commerceWAV2`). ```yaml http: POST /commerce operationId: createCommerce clientGroup: catalog responses: 200, 401, 500 ``` #### `getCommerce` Get Commerce Settings Returns catalog/cart commerce settings for the channel. - `is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `is_cart_enabled` — enable cart (`true`) or disable it (`false`). ```yaml http: GET /commerce operationId: getCommerce clientGroup: catalog responses: 200, 401, 500 ``` ### channel #### `getConversationalAutomation` Get conversational automation settings Get WhatsApp conversational components for the channel (welcome message, ice-breaker prompts, and slash commands). Proxies Meta/360dialog `GET /conversational_automation`. When `enable_welcome_message` is true and a user opens chat for the first time, Meta delivers a webhook message with `type: request_welcome`. The inbound formatter exposes that as `type: "request_welcome"` and `meta.request_welcome: true` so your webhook can send a custom welcome reply. ```yaml http: GET /conversationalAutomation operationId: getConversationalAutomation clientGroup: channel responses: 200, 401, 500 ``` #### `getStatus` Get channel status Returns WhatsApp Business API client connection status. ```yaml http: GET /status operationId: getStatus clientGroup: channel responses: 200, 401, 500 ``` #### `setConversationalAutomation` Set conversational automation settings Update WhatsApp conversational components. Allowed body fields (others are ignored): - `enable_welcome_message` (boolean) - `prompts` (string[], max 4, each ≤ 80 chars) - `commands` (`{ command_name, command_description }[]`) Proxies Meta/360dialog `POST /conversational_automation`. ```yaml http: POST /conversationalAutomation operationId: setConversationalAutomation clientGroup: channel responses: 200, 401, 500 ``` ### flows #### `createFlows` Create Flow ```yaml http: POST /flows operationId: createFlows clientGroup: flows responses: 200 ``` #### `createFlowsFlowIdDeprecate` Deprecate Flow ```yaml http: POST /flows/{flowId}/deprecate operationId: createFlowsFlowIdDeprecate clientGroup: flows responses: 200 ``` #### `createFlowsFlowIdPublish` Publish Flow ```yaml http: POST /flows/{flowId}/publish operationId: createFlowsFlowIdPublish clientGroup: flows responses: 200 ``` #### `deleteFlowsFlowId` Delete Flow ```yaml http: DELETE /flows/{flowId} operationId: deleteFlowsFlowId clientGroup: flows responses: 200 ``` #### `getFlowsFlowId` Get Flow Details ```yaml http: GET /flows/{flowId} operationId: getFlowsFlowId clientGroup: flows responses: 200 ``` #### `getFlowsFlowIdPreview` Preview Flow ```yaml http: GET /flows/{flowId}/preview operationId: getFlowsFlowIdPreview clientGroup: flows responses: 200 ``` #### `getWhatsappBusinessEncryption` Get business encryption public key Retrieve the WhatsApp business public key and signature status for this channel's phone number. Required before publishing or sending Flows that use data encryption. ```yaml http: GET /whatsapp_business_encryption operationId: getWhatsappBusinessEncryption clientGroup: flows responses: 200, 401, 500 ``` #### `listFlows` List Flows ```yaml http: GET /flows operationId: listFlows clientGroup: flows responses: 200 ``` #### `patchFlowsFlowIdAssets` Update Flow Structure ```yaml http: PATCH /flows/{flowId}/assets operationId: patchFlowsFlowIdAssets clientGroup: flows responses: 200 ``` #### `patchFlowsFlowIdMetadata` Update Flow Metadata ```yaml http: PATCH /flows/{flowId}/metadata operationId: patchFlowsFlowIdMetadata clientGroup: flows responses: 200 ``` #### `setWhatsappBusinessEncryption` Set business encryption public key Upload and sign a 2048-bit RSA business public key (PEM) for this channel's phone number. Meta requires a signed key before Flow publish/send. Only one active key per number; a new upload replaces the previous key. ```yaml http: POST /whatsapp_business_encryption operationId: setWhatsappBusinessEncryption clientGroup: flows responses: 200, 400, 401, 500 ``` ### groups #### `createGroups` Create Group ```yaml http: POST /groups operationId: createGroups clientGroup: groups responses: 200 ``` #### `createGroupsGroupId` Update Group Info ```yaml http: POST /groups/{groupId} operationId: createGroupsGroupId clientGroup: groups responses: 200 ``` #### `createGroupsGroupIdInvitelink` Reset Invite Link ```yaml http: POST /groups/{groupId}/inviteLink operationId: createGroupsGroupIdInvitelink clientGroup: groups responses: 200 ``` #### `deleteGroupsGroupId` Delete Group ```yaml http: DELETE /groups/{groupId} operationId: deleteGroupsGroupId clientGroup: groups responses: 200 ``` #### `getGroupsGroupId` Get Group Info ```yaml http: GET /groups/{groupId} operationId: getGroupsGroupId clientGroup: groups responses: 200 ``` #### `getGroupsGroupIdInvitelink` Get Invite Link ```yaml http: GET /groups/{groupId}/inviteLink operationId: getGroupsGroupIdInvitelink clientGroup: groups responses: 200 ``` #### `listGroups` Get Groups List ```yaml http: GET /groups operationId: listGroups clientGroup: groups responses: 200 ``` ### messaging #### `createReadMessage` Mark message as read ```yaml http: POST /readMessage operationId: createReadMessage clientGroup: messaging responses: 200, 401 ``` #### `createUploadMedia` Upload media ```yaml http: POST /uploadMedia operationId: createUploadMedia clientGroup: messaging responses: 200 ``` #### `deleteMedia` Delete media from WABA storage Delete previously uploaded media by numeric `mediaId` (from `/uploadMedia`). This is the canonical deletion endpoint and uses the REST `DELETE` verb on the media resource path. The older `POST /deleteMedia` is a deprecated alias. ```yaml http: DELETE /media/{mediaId} operationId: deleteMedia clientGroup: messaging responses: 200, 400, 401, 500 ``` #### `deleteMediaLegacy` Delete media from WABA storage (deprecated alias) **Deprecated.** Use `DELETE /media/{mediaId}` instead. This POST alias is kept for backward compatibility with earlier integrations. New integrations should call `DELETE /media/{mediaId}`: 1msg follows REST conventions for resource deletion going forward (delete a resource with the `DELETE` verb on its resource path). ```yaml http: POST /deleteMedia operationId: deleteMediaLegacy clientGroup: messaging responses: 200, 400, 401, 500 ``` #### `getMmLiteStatus` Get MM Lite availability and status ```yaml http: GET /mmLiteStatus operationId: getMmLiteStatus clientGroup: messaging responses: 200, 401, 500 ``` #### `listMessages` Get messages list ```yaml http: GET /messages operationId: listMessages clientGroup: messaging responses: 200 ``` #### `retrieveMedia` Retrieve uploaded media metadata Get WABA media URL and metadata by mediaId (from uploadMedia). The returned `url` is temporary and typically expires within ~5 minutes. ```yaml http: GET /retrieveMedia operationId: retrieveMedia clientGroup: messaging responses: 200, 400, 401, 500 ``` #### `sendAddressMessage` Send address request message Request shipping address from the user (WhatsApp interactive `address_message`). **India and Singapore only.** Requires: - Business WhatsApp number registered in that country - Recipient phone matching the country (`+91` ↔ `IN`, `+65` ↔ `SG`) Pass `country: "IN"` or `country: "SG"`. Eligibility is validated upstream; mismatches (e.g. Singapore phone with `country: "IN"`) return errors such as `Unsupported Interactive Message type` (HTTP 200 with `sent: false`). Optional action parameters: `values`, `saved_addresses`, `validation_errors`. ```yaml http: POST /sendAddressMessage operationId: sendAddressMessage clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendButton` Send Reply Buttons Message ```yaml http: POST /sendButton operationId: sendButton clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendCarousel` Send Carousel You can send product cards via Carousel in two ways: Template messages: do not require a 24-hour customer service window between you and the recipient. Use sendTemplate. Free-form messages: can be sent only when a customer service window is open between you and the recipient. Use sendCarousel. The message structure in /sendCarousel is largely similar to sending a template. However, in this case you must explicitly specify all elements that are created in advance when working with templates. This is because the message is sent without using a template. In /sendCarousel, for sending a Catalog Carousel there can be either 1 URL button or one or more quick reply buttons. ```yaml http: POST /sendCarousel operationId: sendCarousel clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendContact` Send a Contact ```yaml http: POST /sendContact operationId: sendContact clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendCtaUrl` Send CTA URL interactive message Send an interactive message with a single call-to-action URL button. ```yaml http: POST /sendCtaUrl operationId: sendCtaUrl clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendFile` Send a File Send a file to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone. ```yaml http: POST /sendFile operationId: sendFile clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendFlow` Send WhatsApp Flow Message Send Interactive WhatsApp Flow message to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone. Use this method to send a published WhatsApp Flow as a service (interactive) message. If the 24-hour window is closed, send a template with a FLOW button via /sendTemplate. ```yaml http: POST /sendFlow operationId: sendFlow clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendList` Send List Message ```yaml http: POST /sendList operationId: sendList clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendLocation` Send a Location Send a location to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone. ```yaml http: POST /sendLocation operationId: sendLocation clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendLocationRequest` Send Location Request Message ```yaml http: POST /sendLocationRequest operationId: sendLocationRequest clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendMessage` Send a Message Send a message to an existing chat. (Only if the dialogue has an Open Session). The message will be added to the queue for sending and delivered even if the phone is disconnected from the Internet or authorization is not passed. Only one of two parameters is needed to determine the destination - chatId or phone. ```yaml http: POST /sendMessage operationId: sendMessage clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendOrderDetails` Send order details (India payments template) Send a WhatsApp **order details** payment / invoice message using a pre-approved **Utility** template that has an `ORDER_DETAILS` button. **India only** (WhatsApp Payments India). Requires: - India WhatsApp Business number - Commerce enabled on the channel (`GET`/`POST /commerce`) - Approved template with an `ORDER_DETAILS` button Use this method when you need structured fields (`order`, `referenceId`, `currency`, `paymentSettings`). The API appends a template button `sub_type: order_details` and sends via the same path as `POST /sendTemplate`. Works **outside the 24-hour session window** (template message). You can also send the same payload yourself with `POST /sendTemplate` by including a button component in `params`: ```json { "type": "button", "sub_type": "order_details", "index": 0, "parameters": [{ "type": "action", "action": { "order_details": { "reference_id": "order-123", "currency": "INR", "order": { "status": "pending", "items": [], "subtotal": { "offset": 100, "value": 50000 } } } } }] } ``` ```yaml http: POST /sendOrderDetails operationId: sendOrderDetails clientGroup: messaging responses: 200, 400, 401, 500 ``` #### `sendPaymentRequest` Send payment request (regional) Send a regional payment request interactive message (beta scaffold). `region` must be IN, SG, or BR. Payload shape follows Meta regional payments docs; verify on stage before production use. Full regional builders are not implemented yet. ```yaml http: POST /sendPaymentRequest operationId: sendPaymentRequest clientGroup: messaging responses: 200, 400, 401, 500 ``` #### `sendProduct` Send a Product ```yaml http: POST /sendProduct operationId: sendProduct clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendReaction` Send Reaction ```yaml http: POST /sendReaction operationId: sendReaction clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` #### `sendSticker` Send sticker message Send a WhatsApp sticker by mediaId or link URL. ```yaml http: POST /sendSticker operationId: sendSticker clientGroup: messaging responses: 200, 400, 401, 429, 500 ``` ### profile #### `getMe` Get Profile Info Get WhatsApp Business Account profile information ```yaml http: GET /me operationId: getMe clientGroup: profile responses: 200, 401, 500 ``` #### `updateMe` Update profile info Update WhatsApp Business Account profile fields. At least one of about, description, email, photo, address, vertical, websites is required. Blocked when the channel subscription limit is exceeded. ```yaml http: POST /me operationId: updateMe clientGroup: profile responses: 200, 401, 422, 500 ``` ### templates #### `addTemplate` Create message template ```yaml http: POST /addTemplate operationId: addTemplate clientGroup: templates responses: 200, 401, 500 ``` #### `listTemplates` Get templates list ```yaml http: GET /templates operationId: listTemplates clientGroup: templates responses: 200 ``` #### `removeTemplate` Remove message template ```yaml http: POST /removeTemplate operationId: removeTemplate clientGroup: templates responses: 200, 401, 500 ``` #### `sendTemplate` Send Template Message Send a WhatsApp template message (works outside the 24-hour session window). Supported `params` button `sub_type` values include: `url`, `quick_reply`, `copy_code` / `coupon_code`, `catalog`, `flow`, `limited_time_offer`, and **`order_details`** (WhatsApp Payments **India only** — requires an approved Utility template with an ORDER_DETAILS button). For India order/invoice payments outside 24h, include a button component: ```json { "type": "button", "sub_type": "order_details", "index": 0, "parameters": [{ "type": "action", "action": { "order_details": { "reference_id": "...", "currency": "INR", "order": {} } } }] } ``` Convenience wrapper with structured fields: `POST /sendOrderDetails`. ```yaml http: POST /sendTemplate operationId: sendTemplate clientGroup: templates responses: 200 ``` ### users #### `blockUser` Block WhatsApp user ```yaml http: POST /blockUser operationId: blockUser clientGroup: users responses: 200, 400, 401, 500 ``` #### `listBlockedUsers` List blocked WhatsApp users Returns users currently blocked on this WhatsApp channel (WABA `GET /block_users`). Same channel token auth as `blockUser` / `unblockUser`. ```yaml http: GET /blockedUsers operationId: listBlockedUsers clientGroup: users responses: 200, 401, 500 ``` #### `unblockUser` Unblock WhatsApp user ```yaml http: POST /unblockUser operationId: unblockUser clientGroup: users responses: 200, 400, 401, 500 ``` ### webhooks #### `getWebhook` Get webhook URL Returns the configured client webhook URL for this channel. ```yaml http: GET /webhook operationId: getWebhook clientGroup: webhooks responses: 200, 401, 500 ``` #### `setWebhook` Set webhook URL Configure the client webhook URL for inbound events. WhatsApp **Calling** events (`field=calls`) are forwarded as passthrough payloads with `type: "calls"` and `instanceId` (connect / status / terminate). Call permission replies arrive on the normal messages path (`call_permission_reply`). Details: **Calling** tag. ```yaml http: POST /webhook operationId: setWebhook clientGroup: webhooks responses: 200, 401, 500 ``` ## Cookbook 1. Install the package from the registry above. 2. Set `MSG_API_TOKEN` and `MSG_INSTANCE_ID`. 3. Create the messaging client with `{baseUrl}/{instanceId}`. 4. Call `sendMessage` inside the 24h window, or `sendTemplate` outside it. 5. Use group/profile/flows/templates APIs for advanced workflows. ## FAQ **Where is the package?** See the registry link in the header table. **TypeScript has createClient — does this SDK?** Generated OpenAPI clients use per-API classes (`MessagingApi`, `ProfileApi`, …) instead of a facade. **Can I use this in a browser?** No — server-side only. Never expose tokens. ## Error handling | Code | Meaning | |------|---------| | 400 | Invalid parameters or body | | 401 | Invalid or missing token | | 429 | Rate limit exceeded | | 500 | Internal server error | ## Regeneration and versioning Docs regenerate with `node gen/generate-sdk-docs-langs.js`. Registry versions are immutable. ## License MIT © 1MSG