Playground API
DocsStatsBlogStudio
Documentation Tree
Technical BlogFeature Deep Dives
  • Introduction
  • Quickstart
    5 min
  • How It Works
  • Recipes & Cookbooks
  • Platform Comparisons
  • Real-World Showcase
  • Interactive Studio
    Studio
  • GraphiQL IDE
    IDE
  • Session Quotas & Activity
  • Network Chaos Simulator
  • Atomic Sandbox Reset
  • Overview & Models
    Hub
  • Users Resource
  • Posts Resource
  • Comments Resource
  • Todos Resource
  • Custom Collections
    Custom
  • Multipart File Uploads
    Upload
  • Dynamic SVG Avatars
    SVG
  • Image Thumbnails
    CDN
  • Relational Filtering
  • Full-Text Search
  • Dynamic Sorting
  • Offset Pagination
  • Cursor Pagination
    Scroll
  • CSV & Excel Export & Import
    IO
  • Custom Collections
    CRUD
  • Overview & Architecture
    Hub
  • JWT Auth Flow
  • Refresh Token Rotation
    Mutex
  • RBAC Permission Matrix
    Roles
  • Expiry Simulation
  • Clock Skew Drift
  • Password Recovery Loop
  • Dual-Mode Sandboxing
  • GraphiQL IDE
    IDE
  • Relational Queries
  • Stateful Mutations
  • Realtime Subscriptions
  • Overview & Flowcharts
    Hub
  • Hosted Checkout
    Stripe
  • Payment Intents API
  • 3DS Challenge Modal
    Modal
  • Customers Vault
  • Charges & Refunds
  • Test Cards Catalog
  • Overview & Channels
    Hub
  • Virtual Email Mailbox
    Mailtrap
  • Virtual SMS Terminal
    Phone
  • In-App Notifications
  • Message Dispatcher
  • Realtime Studio
    Studio
  • Native WebSocket (/ws)
  • Socket.io Gateway
  • Presence & Echo Bot
  • Server-Sent Events (SSE)
    SSE
  • Analytics Telemetry
  • Webhook Subscriptions
  • HMAC SHA-256 Signatures
  • Delivery Logs
  • Manual Retry Simulator
  • Network Latency Delay
  • HTTP Status Codes
  • Rate-Limit Simulator
    429
  • Flaky Network & Jitter
    Chaos
  • Session Quotas & Activity
  • JSON Snapshots
    JSON
  • Headless CI/CD Testing
    CI
  • Mobile QR Code Sync
  • System Metrics & Health
  • Atomic Sandbox Reset
  • Official TypeScript SDK
  • Multi-Language Generators
  • DevTools Extension
  • OpenAPI 3.1 Spec
    JSON
  • Postman Collection v2.1
  • Bruno Collection
  • Insomnia Workspace
  • TypeScript .d.ts
    .d.ts
  • AI Prompt Rules
    Rules
  • Context Index (llms.txt)
  • Full Schema (llms-full.txt)
  • Manifest (product.json)
  • All Feature Articles
    Blog
  • React CRUD Without Backend
    Deep Dive
  • Why Static APIs Fail
  • Mocking Stateful Auth
  • WebSockets & SSE Guide
Technical Blog
Articles

In-depth articles explaining stateful mock APIs, WebSockets, payments, and frontend resilience.

Read Articles
PreviousVirtual SMS Terminal
NextMessage Dispatcher
Virtual Communications

In-App Notifications & Alerts Feed

Simulate in-app notification centers, toast alert streams, and persistent announcement banners. Model read/unread status updates, severity categories (info, success, warning, error), and interactive deep links.

Live Notification CenterAPI Consoles

Interactive Notification Center

Test read/unread state toggles and trigger live simulated toast banners.

Simulate Toast:
Notification Feed2 Unread Alerts
Scheduled Maintenance Noticewarning

Database indexing will take place on Sunday at 02:00 UTC. Zero downtime expected.

10m ago
View
New API Key Provisionedinfo

A new secret key "sk_live_98...21" was generated by Administrator.

1h ago
View
Monthly Subscription Renewedsuccess

Your Pro Developer Plan was successfully charged $29.00 USD.

1d ago
View

Interactive Consoles

Publish notifications to the sandbox feed and query unread counts.

1. Publish Notification

Create In-App Message

POST
response.json
1
{
2
// Click "Send" above to execute this request against the live server.
3
}

2. Query Notifications

List In-App Notifications

GET
response.json
1
{
2
// Click "Send" above to execute this request against the live server.
3
}

Frontend Integration Recipe

React hook for streaming and displaying in-app alerts in real time.

typescript
1
import { useState, useEffect } from 'react';
2
3
export function useInAppNotifications() {
4
const [messages, setMessages] = useState<any[]>([]);
5
6
useEffect(() => {
7
// 1. Initial fetch of notifications
8
fetch('https://playground.nileslabs.com/api/v1/messages')
9
.then(res => res.json())
10
.then(data => setMessages(data.data || []));
11
12
// 2. Stream real-time alerts via SSE
13
const es = new EventSource('https://playground.nileslabs.com/api/v1/stream');
14
es.addEventListener('message.created', (event) => {
15
const newAlert = JSON.parse(event.data);
16
setMessages(prev => [newAlert, ...prev]);
17
});
18
19
return () => es.close();
20
}, []);
21
22
return { messages, unreadCount: messages.filter(m => !m.read).length };
23
}