PAM Native Realtime
Start here
Section titled “Start here”Every PAM Native product runs on the PAM runtime. Install and verify PAM first, create a Native application, and add this package through PAM Composer:
curl -fsSL https://github.com/push-in/pam/releases/latest/download/install.sh | shpam doctorpam init my-app --template nativecd my-apppam composer require pushinbr/pam-native-realtimepam doctorpam native dev$realtime = new Realtime();$realtime->connect( 'wss://api.example.com/socket', ['Authorization' => 'Bearer '.$token], ['pam.v1'], fn (?string $id, ?string $error) => null,);$realtime->poll($id, fn (?RealtimeEvent $event, ?string $error) => null);Realtime connects, sends text/binary, polls, inspects state, and closes;
RealtimeEvent/RealtimeEventKind normalize messages/lifecycle/timeouts;
RealtimeConnectionState types connection state.
Only authenticated wss:// is accepted. Frames are bounded per connection;
incoming events use a 256-item native queue and one pending long poll. Poll
continuously, treat timeout as a lifecycle tick, refresh credentials as needed,
and reconnect with bounded jitter. Android uses OkHttp 5.3.0; iOS uses
URLSessionWebSocketTask.
RealtimePluginProvider registers the transport automatically.