PHPackages                             moderntribe/tribe-alerts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. moderntribe/tribe-alerts

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

moderntribe/tribe-alerts
========================

Tribe Alerts WordPress Plugin

1.7.1(3y ago)0263PHPPHP &gt;=7.4CI passing

Since Apr 20Pushed 1w ago10 watchersCompare

[ Source](https://github.com/moderntribe/tribe-alerts)[ Packagist](https://packagist.org/packages/moderntribe/tribe-alerts)[ Docs](https://github.com/moderntribe/tribe-alerts)[ RSS](/packages/moderntribe-tribe-alerts/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (20)Versions (21)Used By (0)

Tribe Alerts
============

[](#tribe-alerts)

Displays a customizable banner on the screen and remembers when users have dismissed it.

---

Display custom banner alerts on your website.

---

Requirements
------------

[](#requirements)

- [Lando](https://lando.dev/) (Docker-backed local stack)
- PHP 7.4+ (satisfied inside Lando; match `composer.json` platform when running Composer on the host)
- Advanced Custom Fields Pro (installed via Composer; see [Composer authentication](#composer-authentication-acf--private-packages))
- For assets: [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm), Node (see [`.nvmrc`](.nvmrc)), Yarn 1.22+, npm 8.3+

---

Run locally (Lando)
-------------------

[](#run-locally-lando)

### 1. Environment file for WordPress / database

[](#1-environment-file-for-wordpress--database)

Copy the example env file Lando loads:

```
cp dev/lando/.env.example dev/lando/.env
```

Edit `dev/lando/.env` if needed. **`WP_HOME` and `WP_SITEURL` must match the hostname Lando exposes** (see `proxy` → `appserver_nginx` in [`.lando.yml`](.lando.yml); currently `https://tribe-alert.lndo.site`).

### 2. Composer authentication (ACF &amp; private packages)

[](#2-composer-authentication-acf--private-packages)

`composer.json` pulls **ACF Pro** from `connect.advancedcustomfields.com` and **nickford/acf-swatch** from GitHub over SSH. Composer reads **`auth.json` in the project root** for HTTP Basic auth. That file is listed in `.gitignore` and must not be committed.

**Option A — from the sample (Modern Tribe / 1Password)**

[`auth-sample.json`](auth-sample.json) is a template that expects [1Password CLI](https://developer.1password.com/docs/cli/) secret references. From the repo root:

```
cp auth-sample.json auth.json
op inject -i auth-sample.json -o auth.json
```

Adjust vault/item names via environment variables if your team uses different 1Password paths (see placeholders in `auth-sample.json`).

**Option B — manual `auth.json`**

Create `auth.json` in the project root with your ACF subscription credentials (from your ACF account: license key and the signed download URL):

```
{
  "http-basic": {
    "connect.advancedcustomfields.com": {
      "username": "",
      "password": ""
    }
  }
}
```

Use the exact username/password pair ACF documents for Composer.

**GitHub (private VCS package)**

For `git@github.com:nickforddesign/acf-swatch.git`, ensure your machine (or the Lando container) can use that SSH key. Typical approaches:

- Load your SSH agent on the host before `lando start`, or
- Add a deploy key / personal key inside the appserver and run `composer install` there after `lando ssh`.

If Composer fails on `acf-swatch`, fix SSH access to GitHub first.

### 3. Start Lando

[](#3-start-lando)

From the repository root:

```
lando start
```

On start, Lando runs `composer install` and [`dev/lando/install-wp.sh`](dev/lando/install-wp.sh) (WordPress download + `wp core install` when `wp-config.php` is missing).

### 4. Open the site

[](#4-open-the-site)

Use the URL from `.lando.yml` proxy settings (e.g. ****). MailHog is available per your Lando tooling (`lando info`).

### 5. Activate the plugin

[](#5-activate-the-plugin)

In **WP Admin → Plugins**, activate **Tribe Alerts** (and other required plugins such as ACF Pro if not auto-activated).

### Composer and `vendor`

[](#composer-and-vendor)

- You may run **`composer install`** on the **host** (with `auth.json` present) or rely on **`lando composer install`** / the `post-start` hook.
- If `vendor` looks empty on the host while dependencies work in the container, check Lando file-sharing / `excludes` in `.lando.yml`.

---

Front end
---------

[](#front-end)

Front-end builds use [Laravel Mix](https://laravel-mix.com/).

### Building

[](#building)

```
nvm use
```

```
yarn install
```

### Usage

[](#usage)

Build for development:

```
yarn dev
```

Watch for file changes:

```
yarn watch
```

Poll for file changes:

```
yarn watch-poll
```

Watch with hot module replacement:

```
yarn hot
```

Build for production:

```
yarn production
```

Run the Mix CLI directly (same underlying binary the scripts use):

```
npx mix
```

See more options: `npx mix --help`

### Pull requests / building

[](#pull-requests--building)

Run **`yarn prod`** before submitting a PR so [`resources/dist`](resources/dist) contains the latest production assets.

---

Installing this plugin
----------------------

[](#installing-this-plugin)

Every published [release](https://github.com/moderntribe/tribe-alerts/releases) creates a `tribe-alerts.zip` (built, vendor-scoped plugin) shortly after the release is published. To install manually, download the zip from a release and extract it into your WordPress `wp-content/plugins` directory.

### Composer (consumer projects)

[](#composer-consumer-projects)

The best way to include the release zip is with [ffraenz/private-composer-installer](https://github.com/ffraenz/private-composer-installer).

Add a custom repository to your project’s `repositories` in `composer.json`:

```
  "repositories": [
    {
      "type": "package",
      "package": {
        "name": "moderntribe/tribe-alerts",
        "version": "1.1.0",
        "type": "wordpress-plugin",
        "dist": {
          "type": "zip",
          "url": "https://github.com/moderntribe/tribe-alerts/releases/download/{%VERSION}/tribe-alerts.zip"
        },
        "require": {
          "ffraenz/private-composer-installer": "^5.0"
        }
      }
    }
  ]
```

> **Note:** Bump the version above and run `composer update` to upgrade the plugin later.

Add the package to `require`:

```
  "require": {
    "moderntribe/tribe-alerts": "*"
  }
```

Point Composer installers at your WordPress layout (adjust paths for your project):

```
  "extra": {
    "wordpress-install-dir": "wp",
    "installer-paths": {
      "wp-content/mu-plugins/{$name}": [
        "type:wordpress-muplugin"
      ],
      "wp-content/plugins/{$name}": [
        "type:wordpress-plugin"
      ],
      "wp-content/themes/{$name}": [
        "type:wordpress-theme"
      ]
    }
  }
```

Allow the plugins in `config`:

```
    "allow-plugins": {
      "composer/installers": true,
      "ffraenz/private-composer-installer": true
    }
```

Install:

```
composer update
```

---

Displaying an alert
-------------------

[](#displaying-an-alert)

The banner is output on the `wp_footer` hook by default. To render it yourself:

```
