SimpleNS LogoDocs
Official Plugins

Mock Plugin

A testing utility plugin for SimpleNS development and integration testing.


What is Mock Plugin

The @simplens/mock plugin is a lightweight, zero-dependency provider designed specifically for testing and development within the SimpleNS ecosystem. It simulates notification delivery without actually sending anything.

How It Works

This plugin simulates notification delivery by logging to the console. When a notification is sent:

  1. The plugin receives the notification payload
  2. Validates the recipient.user_id and content.message fields
  3. Logs the notification details to the console
  4. Returns { success: true } immediately

No API keys, SMTP servers, or third-party services required. Perfect for CI/CD pipelines and local development.


Installation

npm run plugin:install @simplens/mock

See the Plugin Installation Guide for installing plugins in your simplens-core


Configuration

Add the plugin to your simplens.config.yaml if you used Config-first method from Plugin Installation Guide:

simplens.config.yaml
providers:
  - package: "@simplens/mock"
    id: mock
    credentials: {}
    options:
      priority: 1
      rateLimit:
        maxTokens: 100
        refillRate: 10

channels:
  mock:
    default: "mock"

Required Credentials

KeyDescription
(none)No credentials required!

No credentials required! The mock plugin works out of the box with zero configuration.

Rate Limit

KeyDefaultDescription
maxTokens100Max tokens in bucket
refillRate10Tokens refilled per second

Environment Variables

.env
# No environment variables required for mock plugin

Notification Payload

  • You can easily get and configure this request payload from Payload Studio in Admin Dashboard
{
  "request_id": "uuid-v4",
  "client_id": "uuid-v4",
  "channel": "mock",
  "recipient": {
    "user_id": "user-123"
  },
  "content": {
    "message": "Hello {{name}}, welcome to SimpleNS!"
  },
  "variables": {
    "name": "John"
  }
}

Features

FeatureDescription
Zero DependenciesNo API keys or external services required
Instant ResponseNo network latency or rate limiting
Safe TestingNo real notifications sent
CI/CD ReadyPerfect for automated test suites
Always HealthyhealthCheck() always returns true
Template VariablesSupports {{key}} syntax

On this page