{"id":48658,"library":"nativescript-xmpp-client","title":"NativeScript XMPP Client","description":"A NativeScript plugin providing an XMPP websocket client for iOS and Android. Version 1.2.0 is the current stable release, but it is no longer actively maintained. It uses a stanza-based approach similar to Node-XMPP, with event-driven handling for online, stanza, and error events. Key differentiators: tight integration with NativeScript's runtime, TypeScript support, and WebSocket-only transport (no BOSH).","status":"maintenance","version":"1.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/samuelagm/nativescript-xmpp-client","tags":["javascript","NativeScript","JavaScript","XMPP","WebSocket","Android","iOS","typescript"],"install":[{"cmd":"npm install nativescript-xmpp-client","lang":"bash","label":"npm"},{"cmd":"yarn add nativescript-xmpp-client","lang":"bash","label":"yarn"},{"cmd":"pnpm add nativescript-xmpp-client","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"NativeScript core modules for platform access","package":"tns-core-modules","optional":false},{"reason":"WebSocket implementation for NativeScript","package":"nativescript-websockets","optional":false}],"imports":[{"note":"Default export is not provided; always use named import.","wrong":"const Client = require('nativescript-xmpp-client').Client","symbol":"Client","correct":"import { Client } from 'nativescript-xmpp-client'"},{"note":"Used to build IQ stanzas. Also exported: Message, Presence, Stanza.","wrong":"","symbol":"IQ","correct":"import { IQ } from 'nativescript-xmpp-client'"},{"note":"Used to build Message stanzas.","wrong":"","symbol":"Message","correct":"import { Message } from 'nativescript-xmpp-client'"}],"quickstart":{"code":"import { Client, IQ } from 'nativescript-xmpp-client';\n\nconst client = new Client({\n    websocket: { url: 'ws://127.0.0.1:5280' },\n    jid: 'user@127.0.0.1',\n    password: 'secret'\n});\n\nclient.on('online', (data) => {\n    console.log('Online:', data.jid);\n    const rosterIQ = new IQ({ from: data.jid, type: 'get', id: 'roster1' }).c('query', { xmlns: 'jabber:iq:roster' });\n    client.send(rosterIQ);\n});\n\nclient.on('stanza', (stanza) => {\n    console.log('Stanza:', stanza.root().toString());\n});\n\nclient.on('error', (err) => {\n    console.error('Error:', err);\n});","lang":"typescript","description":"Initializes an XMPP client with websocket connection, logs in, sends a roster IQ, and logs stanzas."},"warnings":[{"fix":"Consider using a different XMPP library or contribute to maintenance.","message":"The package is not actively maintained and may not work with newer NativeScript versions.","severity":"deprecated","affected_versions":">=1.2.0"},{"fix":"Ensure your XMPP server has WebSocket support enabled.","message":"Only WebSocket transport is supported; BOSH or direct TCP are not available.","severity":"gotcha","affected_versions":"*"},{"fix":"Check compatibility or use @nativescript/core instead.","message":"The plugin uses 'tns-core-modules' and may break with NativeScript 7+ due to breaking changes.","severity":"gotcha","affected_versions":">=1.2.0"},{"fix":"Implement comprehensive error handling.","message":"Event 'online' may not fire if authentication fails; always attach 'error' handler.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'1.2.0':17 'activ':28 'android':15,75 'approach':36 'base':35 'bosh':69 'client':3,11 'current':20 'differenti':54 'driven':45 'error':51 'event':44,52 'event-driven':43 'handl':46 'integr':56 'io':13,76 'javascript':70,72 'key':53 'longer':27 'maintain':29 'nativescript':1,5,58,71 'node':40 'node-xmpp':39 'onlin':48 'plugin':6 'provid':7 'releas':22 'runtim':60 'similar':37 'stabl':21 'stanza':34,49 'stanza-bas':33 'support':62 'tight':55 'transport':67 'typescript':61,77 'use':31 'version':16 'websocket':10,65,74 'websocket-on':64 'xmpp':2,9,41,73","created_at":"2026-06-07T16:57:46.134826+00:00","updated_at":"2026-06-07T16:57:46.134826+00:00","problems":[{"fix":"Run 'npm install nativescript-websockets --save' or 'tns install nativescript-websockets'.","cause":"Missing peer dependency","error":"Error: Cannot find module 'nativescript-websockets'"},{"fix":"Ensure you use 'new Client(...)' and import { Client } correctly.","cause":"Client not properly instantiated or imported incorrectly","error":"TypeError: client.on is not a function"},{"fix":"Verify server URL and that WebSocket is enabled on the XMPP server.","cause":"XMPP server not running or WebSocket endpoint incorrect","error":"Error: WebSocket connection to 'ws://...' failed: Connection refused"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/samuelagm/nativescript-xmpp-client","github":"https://github.com/samuelagm/nativescript-xmpp-client","docs":null,"changelog":null,"pypi":null,"npm":"nativescript-xmpp-client","openapi_spec":null,"status_page":null,"smithery":null,"categories":["communication"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}