You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are only a few options to configure the Nuxt WebSocket module. They are all optional and you can set these options in your `nuxt.config.ts` file.
8
+
9
+
A complete example would look like this:
10
+
11
+
```ts [nuxt.config.ts]
12
+
exportdefaultdefineNuxtConfig({
13
+
modules: ['nuxt-ws'],
14
+
15
+
ws: {
16
+
path: '/_ws',
17
+
topics: {
18
+
defaults: ['session'],
19
+
internals: ['_internal', 'notifications'],
20
+
},
21
+
}
22
+
})
23
+
```
24
+
25
+
## Options
26
+
27
+
::field-group
28
+
::field{name="path"type="string"}
29
+
Defines the default path for `useWS` to connect to the WebSocket server. - Default to `undefined`
30
+
::
31
+
32
+
::field{name="topics.defaults"type="string[]"}
33
+
Defines the topics that are automatically subscribed to when a connection is established. - Default to `[]`
34
+
::
35
+
36
+
::field{name="topics.internals"type="string[]"}
37
+
Defines the topics that are considered internal and can only be listened to by the clients. Interactions with these are only possible via `hooks` - Default to `[]`
0 commit comments