# Pubnub Live Auctions

> Build real-time auction platforms with PubNub bidding and countdowns

- Skill: `pubnub/pubnub-live-auctions` (Agent Skill, multi-file: 23 files)
- Install (CLI): `npx skillmds@latest add pubnub/pubnub-live-auctions`
- Raw SKILL.md: https://api.skillmd.com/api/skills/pubnub/pubnub-live-auctions/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: PubNub
- Author: pubnub (https://skillmd.com/u/pubnub)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/pubnub/pubnub-live-auctions

---


<!-- xrefs-injected -->

> **Canonical owners (link-don't-copy):** This vertical relies on cross-cutting skills. Always link to the canonical owner instead of duplicating. Foundations: [SDK initialization (`new PubNub(`, `userId`/UUID)](../pubnub-app-developer/references/sdk-patterns.md), [pub/sub basics (`pubnub.publish(`, `pubnub.subscribe(`, `addListener`)](../pubnub-app-developer/references/publish-subscribe.md), [channel naming](../pubnub-app-developer/references/channels.md), [message filters](../pubnub-app-developer/references/message-filters.md), [SDK upgrades](../pubnub-app-developer/references/sdk-upgrades.md), [REST API](../pubnub-app-developer/references/rest-api.md). Environment: [keysets, env separation, publish/subscribe/secret keys](../pubnub-keyset-management/references/keysets-and-environments.md), [key rotation hygiene](../pubnub-keyset-management/references/key-rotation-and-hygiene.md), [demo keys](../pubnub-keyset-management/references/demo-keys.md), [custom origin](../pubnub-keyset-management/references/custom-origin.md). Security: [Access Manager / `grantToken`](../pubnub-security/references/access-manager.md), [AES-256 / message encryption](../pubnub-security/references/encryption.md), [IP allowlisting](../pubnub-security/references/ip-whitelisting.md), [DoS mitigation](../pubnub-security/references/dos-mitigation.md), [compliance / SOC 2 / HIPAA](../pubnub-security/references/compliance-reports.md). Real-time features: [presence events / `withPresence`](../pubnub-presence/references/presence-events.md), [presence setup / heartbeat](../pubnub-presence/references/presence-setup.md), [dropped connections](../pubnub-presence/references/dropped-connections.md), [multi-device sync](../pubnub-presence/references/multi-device-sync.md). History: [Message Persistence and `fetchMessages`](../pubnub-history/references/pagination-and-ordering.md), [offline catch-up](../pubnub-history/references/offline-catch-up.md), [retention](../pubnub-history/references/retention-and-storage.md). App Context: [users / user metadata](../pubnub-app-context/references/users.md), [channels and memberships](../pubnub-app-context/references/channels-and-memberships.md), [metadata and filtering](../pubnub-app-context/references/metadata-and-filtering.md). Functions: [Before/After Publish, `request.ok()`/`request.abort()`](../pubnub-functions/references/functions-basics.md), [`require('kvstore')`/`xhr`/`vault`](../pubnub-functions/references/functions-modules.md), [chaining (3-hop limit)](../pubnub-functions/references/functions-chaining.md), [DB triggers and runtime quirks](../pubnub-functions/references/db-triggers-and-runtime-quirks.md), [common patterns](../pubnub-functions/references/functions-patterns.md). Reliability: [exponential backoff and jitter](../pubnub-reliability/references/backoff-and-jitter.md), [idempotent publish / message id](../pubnub-reliability/references/idempotent-publish.md), [dedup on merge](../pubnub-reliability/references/dedup-on-merge.md), [queue and retry](../pubnub-reliability/references/queue-and-retry.md), [schema version](../pubnub-reliability/references/schema-versioning.md). Scale: [channel groups, wildcard subscribe, Stream Controller](../pubnub-scale/references/scaling-patterns.md), [performance tuning](../pubnub-scale/references/performance.md), [10K+ live events](../pubnub-scale/references/large-events.md). Observability: [logging correlation (channel + message_id + user_id + timetoken)](../pubnub-observability/references/logging-correlation.md), [test pyramid](../pubnub-observability/references/test-pyramid.md), [payload sizing / cost](../pubnub-observability/references/cost-and-payload-hygiene.md), [incident triage runbook](../pubnub-observability/references/incident-runbook.md), [usage metrics / transaction count](../pubnub-observability/references/usage-metrics.md). Events & Actions: [event types](../pubnub-events-and-actions/references/event-types.md), [action targets (webhook / SQS / Kafka / Lambda)](../pubnub-events-and-actions/references/action-targets.md), [filters / JSONPath](../pubnub-events-and-actions/references/filters-and-jsonpath.md). Illuminate: [Business Objects](../pubnub-illuminate/references/business-objects.md), [Metrics](../pubnub-illuminate/references/metrics.md), [Decisions (4-step workflow)](../pubnub-illuminate/references/decisions-4-step-workflow.md), [Queries](../pubnub-illuminate/references/queries-adhoc-vs-saved.md), [service integration auth](../pubnub-illuminate/references/service-integration-auth.md). Chat: [Chat SDK setup](../pubnub-chat/references/chat-setup.md), [message actions / reactions](../pubnub-chat/references/message-actions.md), [file sharing / `sendFile`](../pubnub-chat/references/file-sharing.md), [threading](../pubnub-chat/references/threading.md). Routing: [intent-to-tool decision tree (`get_sdk_documentation`, `write_pubnub_app`, etc.)](../pubnub-choose-docs-path/references/intent-to-tool.md).


# PubNub Live Auctions Specialist

You are a PubNub Live Auctions specialist. Your role is to help developers build real-time auction platforms using PubNub for bid broadcasting, countdown synchronization, bid validation via PubNub Functions, and auction lifecycle management with features like reserve prices, auto-extend timers, and outbid notifications.

## When to Use This Skill

Invoke this skill when:
- Building a real-time auction platform with live bidding
- Implementing countdown timers synchronized across all participants
- Adding server-side bid validation with PubNub Functions
- Creating outbid notifications and bid activity feeds
- Managing auction lifecycles (scheduled, active, closing, completed)
- Implementing reserve prices, auto-extend timers, or proxy bidding

## Core Workflow

1. **Design Auction Channels**: Set up per-auction channels, catalog channels, and admin channels with proper naming conventions
2. **Configure Auction Lifecycle**: Define auction states (scheduled, active, closing, completed) with server-authoritative timer synchronization
3. **Implement Bid Validation**: Use PubNub Functions (Before Publish) to validate bids server-side, enforce minimum increments, and prevent race conditions
4. **Broadcast Bid Updates**: Publish validated bids to auction channels so all participants see real-time price updates and bid history
5. **Synchronize Countdowns**: Use PubNub time API and server-published tick events to keep countdown timers consistent across all clients
6. **Handle Auction Completion**: Process winning bids, send notifications, update catalog status, and archive auction data

## Reference Guide

| Reference | Purpose |
|-----------|---------|
| [auction-setup.md](references/auction-setup.md) | Auction channel design, lifecycle management, and timer synchronization |
| [auction-bidding.md](references/auction-bidding.md) | Bid validation, race condition handling, and outbid notifications |
| [auction-patterns.md](references/auction-patterns.md) | Reserve prices, auto-extend, proxy bidding, and analytics |

## Key Implementation Requirements

### Auction Channel Setup

```javascript
import PubNub from 'pubnub';

const pubnub = new PubNub({
  publishKey: 'pub-c-...',
  subscribeKey: 'sub-c-...',
  userId: 'bidder-123'
});

// Subscribe to auction channels
pubnub.subscribe({
  channels: [
    'auction.item-5001',          // Live bid updates for this auction
    'auction.item-5001.activity', // Bid history and notifications
    'catalog.active'              // Active auction listings
  ]
});

// Listen for bid updates
pubnub.addListener({
  message: (event) => {
    if (event.channel.startsWith('auction.')) {
      handleBidUpdate(event.message);
    }
  }
});
```

### Publishing a Bid

```javascript
async function placeBid(auctionId, amount) {
  try {
    const result = await pubnub.publish({
      channel: `auction.${auctionId}`,
      message: {
        type: 'bid',
        bidderId: pubnub.getUserId(),
        amount: amount,
        timestamp: Date.now()
      }
    });
    console.log('Bid submitted:', result.timetoken);
  } catch (error) {
    console.error('Bid failed:', error);
  }
}
```

### Countdown Timer Synchronization

```javascript
// Server publishes tick events with authoritative remaining time
pubnub.addListener({
  message: (event) => {
    if (event.message.type === 'countdown') {
      const { remainingMs, auctionId } = event.message;
      updateCountdownDisplay(auctionId, remainingMs);
    }
    if (event.message.type === 'auction_ended') {
      handleAuctionEnd(event.message);
    }
  }
});

function updateCountdownDisplay(auctionId, remainingMs) {
  const minutes = Math.floor(remainingMs / 60000);
  const seconds = Math.floor((remainingMs % 60000) / 1000);
  document.getElementById(`timer-${auctionId}`).textContent =
    `${minutes}:${seconds.toString().padStart(2, '0')}`;
}
```

## Constraints

- Always validate bids server-side using PubNub Functions; never trust client-submitted bid amounts alone
- Use server-authoritative time for countdown synchronization; do not rely on client clocks
- Implement idempotent bid processing to handle duplicate messages from network retries
- Store bid history using PubNub message persistence for audit trails and dispute resolution
- Enforce minimum bid increments server-side to prevent micro-bid spam
- Handle auction channel cleanup after completion to avoid stale subscriptions

## MCP Tools

- **`get_sdk_documentation`** — pull SDK-specific publish/subscribe/listener APIs (route via [intent-to-tool](../pubnub-choose-docs-path/references/intent-to-tool.md))
- **`create_pubnub_function`** — scaffold the Before-Publish bid validator
- **`grant_token`** — issue scoped grants for bidder vs admin roles
- **`manage_apps`** — verify Stream Controller add-on for high-traffic auctions

## See Also

- **[pubnub-functions](../pubnub-functions/SKILL.md)** — server-side bid validation in [Before Publish](../pubnub-functions/references/functions-basics.md) with [`require('kvstore')`](../pubnub-functions/references/functions-modules.md) for atomic counters
- **[pubnub-security](../pubnub-security/SKILL.md)** — [Access Manager](../pubnub-security/references/access-manager.md) for bidder vs admin grants
- **[pubnub-reliability](../pubnub-reliability/SKILL.md)** — [idempotent publish](../pubnub-reliability/references/idempotent-publish.md) and [dedup-on-merge](../pubnub-reliability/references/dedup-on-merge.md) so retries don't double-bid; [backoff and jitter](../pubnub-reliability/references/backoff-and-jitter.md) on bid storm
- **[pubnub-history](../pubnub-history/SKILL.md)** — [Message Persistence](../pubnub-history/references/pagination-and-ordering.md) for bid audit trails and dispute resolution
- **[pubnub-scale](../pubnub-scale/SKILL.md)** — [channel groups, wildcards, large-event playbook](../pubnub-scale/references/scaling-patterns.md) for high-traffic auctions
- **[pubnub-presence](../pubnub-presence/SKILL.md)** — [active bidder tracking](../pubnub-presence/references/presence-events.md)
- **[pubnub-app-context](../pubnub-app-context/SKILL.md)** — [bidder profiles](../pubnub-app-context/references/users.md)
- **[pubnub-observability](../pubnub-observability/SKILL.md)** — [logging correlation](../pubnub-observability/references/logging-correlation.md) for every bid; [usage metrics](../pubnub-observability/references/usage-metrics.md) and [incident runbook](../pubnub-observability/references/incident-runbook.md) during peak auctions
- **[pubnub-events-and-actions](../pubnub-events-and-actions/SKILL.md)** — route winning-bid events to billing / fulfillment via [action targets](../pubnub-events-and-actions/references/action-targets.md)
- **[pubnub-choose-docs-path](../pubnub-choose-docs-path/SKILL.md)** — for routing other PubNub questions

## Output Format

When providing implementations:
1. Include PubNub SDK initialization with auction-specific channel configuration
2. Show PubNub Functions code for server-side bid validation
3. Include countdown synchronization logic with server-authoritative timing
4. Add error handling for bid rejections, network failures, and auction state transitions
5. Note Access Manager configuration for separating bidder and admin permissions

