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
{{ message }}
This repository was archived by the owner on May 6, 2022. It is now read-only.
_Defined in [server/express-spokestack-middleware.ts:36](https://github.com/spokestack/node-spokestack/blob/8b22e98/src/server/express-spokestack-middleware.ts#L36)_
199
+
_Defined in [server/expressMiddleware.ts:37](https://github.com/spokestack/node-spokestack/blob/d0640e3/src/server/expressMiddleware.ts#L37)_
87
200
88
201
Express middleware for adding a proxy to the Spokestack GraphQL API.
89
202
A proxy is necessary to avoid exposing your Spokestack token secret on the client.
_Defined in [server/spokestack-socket-server.ts:22](https://github.com/spokestack/node-spokestack/blob/8b22e98/src/server/spokestack-socket-server.ts#L22)_
124
-
125
-
Adds a web socket server to the given HTTP server
126
-
to stream ASR using Google Speech.
127
-
This uses the "ws" node package for the socket server.
128
-
129
-
```js
130
-
import { createServer } from'http'
131
-
constport=parseInt(process.env.PORT||'3000', 10)
132
-
constserver=createServer() // Optionally pass an express app
133
-
googleASRSocketServer(server)
134
-
server.listen(port, () => {
135
-
console.log(`Listening at http://localhost:${port}`)
136
-
})
137
-
```
138
-
139
-
#### Parameters:
140
-
141
-
| Name | Type |
142
-
| -------- | ------ |
143
-
|`server`| Server |
144
-
145
-
**Returns:** void
146
-
147
232
### encryptSecret
148
233
149
234
▸ **encryptSecret**(`body`: string): string
150
235
151
-
_Defined in [server/encryptSecret.ts:13](https://github.com/spokestack/node-spokestack/blob/8b22e98/src/server/encryptSecret.ts#L13)_
236
+
_Defined in [server/encryptSecret.ts:13](https://github.com/spokestack/node-spokestack/blob/d0640e3/src/server/encryptSecret.ts#L13)_
152
237
153
238
This is a convenience method for properly authorizing
154
239
requests to the Spokestack graphql API.
155
240
156
241
**Note:** Do not to expose your key's secret on the client.
157
242
This should only be done on the server.
158
243
159
-
See <ahref="https://github.com/spokestack/node-spokestack/blob/develop/src/server/express-spokestack-middleware.ts">server/express-spokestack-middleware.ts</a>
244
+
See <ahref="https://github.com/spokestack/node-spokestack/blob/develop/src/server/expressMiddleware.ts">server/expressMiddleware.ts</a>
160
245
for example usage.
161
246
162
247
#### Parameters:
@@ -175,9 +260,9 @@ These functions are available exports from `spokestack/client`.
_Defined in [client/concatenateAudioBuffers.ts:4](https://github.com/spokestack/node-spokestack/blob/8b22e98/src/client/concatenateAudioBuffers.ts#L4)_
492
+
_Defined in [client/concatenateAudioBuffers.ts:4](https://github.com/spokestack/node-spokestack/blob/d0640e3/src/client/concatenateAudioBuffers.ts#L4)_
408
493
409
494
A utility method to concatenate two AudioBuffers
410
495
@@ -422,7 +507,7 @@ A utility method to concatenate two AudioBuffers
0 commit comments