{"_id":"@adeeliore/p2p-lan-signaling","name":"@adeeliore/p2p-lan-signaling","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@adeeliore/p2p-lan-signaling","version":"0.1.0","description":"React Native LAN/offline signaling host and discovery adapter for @adeeliore/p2p-core.","license":"0BSD","private":false,"main":"./dist/index.js","react-native":"./dist/index.js","types":"./dist/index.d.ts","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","react-native":"./dist/index.js","default":"./dist/index.js"},"./app.plugin":"./app.plugin.js","./plugin/withP2PLanSignaling":"./plugin/withP2PLanSignaling.js"},"keywords":["p2p","lan","offline","react-native","expo","webrtc","signaling"],"scripts":{"build":"node ../../node_modules/typescript/lib/tsc.js -p tsconfig.build.json","typecheck":"node ../../node_modules/typescript/lib/tsc.js -p tsconfig.json --noEmit","test":"npm run build && node --test tests/**/*.test.cjs","prepublishOnly":"npm run build"},"peerDependencies":{"@adeeliore/p2p-core":"0.1.x","react-native":">=0.74"},"publishConfig":{"access":"public"},"devDependencies":{"typescript":"^5.9.3"},"gitHead":"74318bed01a4f6b791c068c385586f072cfb9a4a","_id":"@adeeliore/p2p-lan-signaling@0.1.0","_nodeVersion":"26.0.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-X/kj+GqQNCQCO7SFN9D9RK9Yh1UmPAxDvYD1+5d4vngNY55IiNAf9MKmCwph4+4yI+mEZfcLemg4+aL5hDcPkA==","shasum":"5263b26eee3450297a9ac17d7a052d1bb548d265","tarball":"https://registry.npmjs.org/@adeeliore/p2p-lan-signaling/-/p2p-lan-signaling-0.1.0.tgz","fileCount":43,"unpackedSize":94954,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD9fmmj9tPk/ug8vVSndMi3C4PicOdAbsUsTX/gZs7JLAIhAP42u6nA4bOTie0C4puj070aXv4sgkvpPitMjOVj13iH"}]},"_npmUser":{"name":"adeeliore","email":"adelyaflaffy@gmail.com"},"directories":{},"maintainers":[{"name":"adeeliore","email":"adelyaflaffy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/p2p-lan-signaling_0.1.0_1780778448886_0.23272891109156002"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-06T20:40:48.658Z","0.1.0":"2026-06-06T20:40:49.028Z","modified":"2026-06-06T20:40:49.270Z"},"maintainers":[{"name":"adeeliore","email":"adelyaflaffy@gmail.com"}],"description":"React Native LAN/offline signaling host and discovery adapter for @adeeliore/p2p-core.","keywords":["p2p","lan","offline","react-native","expo","webrtc","signaling"],"license":"0BSD","readme":"# `@adeeliore/p2p-lan-signaling`\n\nLAN and offline signaling adapter for React Native apps.\n\nThis package adds two things on top of a P2P app architecture:\n\n- native LAN signaling host on Android and iOS;\n- room discovery over `_drawin._tcp`;\n- a signaling-provider adapter compatible with `@adeeliore/p2p-core`;\n- an Expo config plugin that restores native code after `expo prebuild`.\n\nPrimary public naming uses the `Lan*` prefix.\n`Offline*` exports remain available as compatibility aliases for existing app code.\n\n## Installation\n\n```bash\nnpm install @adeeliore/p2p-lan-signaling\n```\n\nIf the app also uses the P2P runtime:\n\n```bash\nnpm install @adeeliore/p2p-core\n```\n\n## Typical Flow\n\n### Host device\n\n```ts\nimport { startLanSignalingHost } from '@adeeliore/p2p-lan-signaling';\n\nconst host = await startLanSignalingHost({\n  port: 8080,\n  roomId: 'ROOM-ABCD1234',\n  displayName: 'Workshop board',\n  roomSecret: 'shared-secret',\n});\n```\n\n### Participant device\n\n```ts\nimport { discoverLanSignalingRooms } from '@adeeliore/p2p-lan-signaling';\n\nconst rooms = await discoverLanSignalingRooms();\nconst selectedRoom = rooms[0];\n```\n\n### Connect the P2P runtime\n\n```ts\nimport { createP2PSession } from '@adeeliore/p2p-core';\nimport {\n  createLanSignalingProvider,\n  startLanSignalingHost,\n} from '@adeeliore/p2p-lan-signaling';\n\nconst host = await startLanSignalingHost({\n  roomId: 'ROOM-ABCD1234',\n  displayName: 'Workshop board',\n  roomSecret: 'shared-secret',\n});\n\nconst session = createP2PSession({\n  sessionId: 'ROOM-ABCD1234',\n  clientId: 'teacher',\n  accessToken: 'shared-secret',\n  signalingProvider: createLanSignalingProvider(host.url!),\n});\n\nsession.connect();\n```\n\n## Expo Plugin\n\nAdd the package plugin to app config:\n\n```json\n{\n  \"expo\": {\n    \"plugins\": [\n      \"@adeeliore/p2p-lan-signaling/app.plugin\"\n    ]\n  }\n}\n```\n\nThen rebuild the native app:\n\n```bash\nnpx expo prebuild -p android\nnpx expo prebuild -p ios\n```\n\n## Security Defaults\n\n- room discovery advertises room metadata, not the room secret;\n- protected rooms use `accessToken` or `roomSecret`;\n- native hosts validate room id, client id, participant count and frame size.\n\n## Error Model\n\nProvider and native-boundary failures use stable error codes.\n\nExamples:\n\n- `ERR_UNSUPPORTED_PLATFORM`\n- `ERR_NATIVE_MODULE_MISSING`\n- `ERR_SIGNALING_NOT_CONNECTED`\n- `ERR_INVALID_SIGNAL_MESSAGE`\n- `ERR_SIGNALING_SOCKET_ERROR`\n\n## Documentation\n\n- usage-oriented API reference: [API_REFERENCE.md](/Users/whoami/diplom-p2p/DrawingApp/packages/p2p-lan-signaling/API_REFERENCE.md)\n- changelog: [CHANGELOG.md](/Users/whoami/diplom-p2p/DrawingApp/packages/p2p-lan-signaling/CHANGELOG.md)\n","readmeFilename":"README.md","_rev":"1-141a21c93d272357ab6dbf2ffac44334"}