Logux’s headers are an API to set session data like selected language.

The client can define an object with any keys inside. We recommend doing it before connecting to the server.

  • store.client.node.setLocalHeaders({ locale: 'fr-FR' })

    During the session, you can change headers by calling this method again. If the next headers miss some keys from the previous call, these keys will be removed.

    Note, that you should manually synchronize headers changes between browser tabs.

    On the server, you can get the client’s headers during the authentication, action, or channel processing.

  •   process (ctx, action, meta) {
          type: 'notification',
          message: I18N[ctx.headers.locale || 'en-US'].success