npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pluskode/client-ios

v0.1.2

Published

Pluskode Client SDK for iOS - Swift client with HTTP, WebSocket, SSE, gRPC, MQTT, and Binary Stream support

Downloads

20

Readme

Pluskode iOS Client SDK

Swift client SDK for Pluskode Backend Framework.

Status

Core Implementation Complete - Basic structure and HTTP/WebSocket ready

Features

  • ✅ HTTP client (URLSession)
  • ✅ WebSocket client (URLSessionWebSocketTask)
  • 🚧 SSE client (EventSource) - Basic structure
  • ✅ gRPC client (HTTP-based)
  • ✅ MQTT client (WebSocket-based)
  • ✅ Binary stream support
  • ✅ Auto-reconnect
  • ✅ Offline queue
  • ✅ Authentication (Bearer, Basic)
  • ✅ Swift Concurrency (async/await)

Installation

Swift Package Manager

Add to your Package.swift:

dependencies: [
    .package(url: "https://github.com/pluskode/client-ios.git", from: "0.1.0")
]

Or in Xcode:

  1. File → Add Packages...
  2. Enter package URL: https://github.com/pluskode/client-ios.git
  3. Select version

CocoaPods

pod 'PluskodeClient', '~> 0.1.0'

Usage

Basic Setup

import PluskodeClient

let client = PluskodeClient(
    options: PluskodeClientOptions(
        baseURL: "http://localhost:3000",
        timeout: 30.0,
        retries: 3
    )
)

// Set authentication
client.setAuth(type: "Bearer", token: "your-jwt-token")

HTTP Requests

// GET request
let users: [User] = try await client.get("/api/users")

// POST request
let newUser = try await client.post(
    "/api/users",
    data: [
        "name": "John",
        "email": "[email protected]"
    ]
)

// PUT, PATCH, DELETE
try await client.put("/api/users/123", data: ["name": "Jane"])
try await client.patch("/api/users/123", data: ["email": "[email protected]"])
try await client.delete<EmptyResponse>("/api/users/123")

WebSocket

// Subscribe to channel
let unsubscribe = client.subscribe(channel: "chat/room1") { data in
    print("Message: \(data)")
}

// Send message
try client.send(channel: "chat/room1", data: ["text": "Hello!"])

// Unsubscribe
unsubscribe()

Server-Sent Events (SSE)

let unsubscribe = client.subscribeSSE(path: "/events/stream") { event in
    print("Event: \(event.event ?? "message"), Data: \(event.data)")
}

// Close
unsubscribe()

gRPC

let user = try await client.rpc(
    service: "UserService",
    method: "GetUser",
    request: ["id": "123"]
) as User

MQTT

// Subscribe
let unsubscribe = client.subscribeMQTT(
    topic: "sensors/temperature",
    callback: { topic, message, qos in
        print("\(topic): \(message) (QoS: \(qos))")
    },
    options: MQTTOptions(qos: 1)
)

// Publish
try await client.publishMQTT(
    topic: "sensors/temperature",
    message: "25.5",
    options: MQTTOptions(qos: 1, retain: false)
)

Binary Streams

let close = client.connectBinary(path: "/custom-protocol") { data in
    print("Received \(data.count) bytes")
}

// Close
close()

SwiftUI Example

import SwiftUI
import PluskodeClient

struct UsersView: View {
    @State private var users: [User] = []
    @State private var isLoading = false
    
    let client = PluskodeClient(
        options: PluskodeClientOptions(baseURL: "http://localhost:3000")
    )
    
    var body: some View {
        List(users) { user in
            Text(user.name)
        }
        .task {
            isLoading = true
            do {
                users = try await client.get("/api/users")
            } catch {
                print("Error: \(error)")
            }
            isLoading = false
        }
    }
}

Project Structure

client/ios/
├── Sources/
│   └── PluskodeClient/
│       ├── PluskodeClient.swift
│       └── EventSource.swift
├── Tests/
├── Package.swift
└── README.md

Requirements

  • iOS 13.0+ / macOS 10.15+ / watchOS 6.0+ / tvOS 13.0+
  • Swift 5.9+
  • Xcode 15.0+

Dependencies

  • Foundation (built-in)
  • Combine (built-in)

Optional (for full gRPC/MQTT):

  • gRPC-Swift
  • CocoaMQTT

License

MIT


Note: This is a working implementation with core features. Full gRPC and MQTT native libraries can be added as optional dependencies.