Feathers Client =============== One of the most notable features of Feathers is that it can also be used as the client. In contrast with most other frameworks, it isn’t a separate library; instead you get the exact same functionality with a client and on a server. This means you can use :doc:`./hooks` and configure plugins. By default, a Feathers client automatically creates services that talk to a Feathers server. In order to connect to a Feathers server, a client creates :doc:`./services` that use a REST or websocket connection to relay method calls and allow listening to :doc:`./events` on the server. This means the :ref:`Feathers application instance ` is usable the exact same way as on the server. Modules most relevant on the client are: - ``@feathersjs/feathers`` to initialize a new Feathers :doc:`./application` - :doc:`./client/rest` to connect to services through :doc:`./express`. - :doc:`./client/socketio` to connect to services through :doc:`./socketio`. - :doc:`./client/primus` to connect to services through :doc:`./primus`. - :doc:`./authentication/client` to authenticate a client .. .. important:: You do not have to use Feathers on the client to connect to a Feathers server. The client chapters above also describe how to use a REST HTTP, Socket.io or Primus connection directly without Feathers on the client side. For details on authentication, see the :doc:`./authentication/client`. This chapter describes how to set up Feathers as the client in Node, React Native and in the browser with a module loader like Webpack or Browserify or through a ```` .. raw:: html .. .. important:: When you are loading @feathersjs/client you do not have to install or load any of the other modules listed in the table above. When to use ~~~~~~~~~~~ ``@feathersjs/client`` can be used directly in the browser using a `` RequireJS ~~~~~~~~~ Here’s how to load feathers-client using RequireJS Syntax: .. code:: js define(function (require) { const feathers = require('@feathersjs/client'); const io = require('socket.io-client'); const socket = io('http://localhost:3030'); // @feathersjs/client is exposed as the `feathers` global. const app = feathers(); app.configure(feathers.socketio(socket)); app.configure(feathers.authentication()); app.service('messages').create({ text: 'A new message' }); return const; }); .. |npm version| image:: https://img.shields.io/npm/v/@feathersjs/client.png?style=flat-square :target: https://www.npmjs.com/package/@feathersjs/client .. |Changelog| image:: https://img.shields.io/badge/changelog-.md-blue.png?style=flat-square :target: https://github.com/feathersjs/client/blob/master/CHANGELOG.md