Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/avikalpg/byok-relay
/ functions
Functions
35 in github.com/avikalpg/byok-relay
⨍
Functions
35
◇
Types & classes
2
↓ 4 callers
Function
getToken
()
examples/react-vite/src/relay.js:13
↓ 3 callers
Function
ensureToken
(appId = 'react-vite-example')
examples/react-vite/src/relay.js:32
↓ 3 callers
Function
getEncryptionKey
()
src/db.js:119
↓ 2 callers
Function
_getHmacKey
* Returns the HMAC key used to hash relay tokens. * Uses TOKEN_HMAC_SECRET if set; otherwise falls back to ENCRYPTION_SECRET. * Both are acceptable;
src/db.js:163
↓ 2 callers
Function
_hmac
* Returns the HMAC-SHA256 hex digest of `token` using `key`.
src/db.js:172
↓ 2 callers
Function
hashToken
* Hash a plaintext relay token for safe storage.
src/db.js:179
↓ 2 callers
Function
listKeys
()
examples/react-vite/src/relay.js:74
↓ 1 callers
Function
_migrateTokenColumn
()
src/db.js:67
↓ 1 callers
Function
clearToken
()
examples/react-vite/src/relay.js:21
↓ 1 callers
Function
createUser
* Create a new user. * * @returns {{ id: string, token: string }} * `token` is the **plaintext** random token — returned to the caller ONCE, *
src/db.js:192
↓ 1 callers
Function
decryptApiKey
(encryptedHex, ivHex, authTagHex)
src/db.js:145
↓ 1 callers
Function
deleteKey
(userId, provider)
src/db.js:236
↓ 1 callers
Function
deleteKey
(provider)
examples/react-vite/src/relay.js:87
↓ 1 callers
Function
encryptApiKey
(plaintext)
src/db.js:132
↓ 1 callers
Function
forwardRequest
* Forward a request to the AI provider. * Returns a node-fetch Response (streaming-capable). * * @param {string} provider - Provider name from PROV
src/providers.js:299
↓ 1 callers
Function
getDecryptedKey
(userId, provider)
src/db.js:230
↓ 1 callers
Function
getUserByToken
* Look up a user by their plaintext relay token. * Hashes the token before querying so plaintext is never compared in SQL.
src/db.js:208
↓ 1 callers
Function
hydrateKeyState
()
examples/react-vite/src/App.jsx:33
↓ 1 callers
Function
ipToInt
Convert a dotted-decimal IPv4 string to a 32-bit unsigned integer.
src/providers.js:51
↓ 1 callers
Function
ipv6ToBigInt
* Parse a colon-separated IPv6 address string (without surrounding brackets) * into a 128-bit BigInt. Returns null on any parse error.
src/providers.js:88
↓ 1 callers
Function
isBlockedIp
Return true if ipStr falls inside any blocked CIDR range.
src/providers.js:60
↓ 1 callers
Function
isBlockedIpv6
Return true if an IPv6 address string (without brackets) is in a blocked range.
src/providers.js:127
↓ 1 callers
Function
listProviders
(userId)
src/db.js:240
↓ 1 callers
Function
saveToken
(token)
examples/react-vite/src/relay.js:17
↓ 1 callers
Function
storeKey
(provider, apiKey)
examples/react-vite/src/relay.js:54
↓ 1 callers
Function
streamChat
({ provider, model, messages, onChunk })
examples/react-vite/src/relay.js:111
↓ 1 callers
Function
upsertKey
(userId, provider, plaintextKey)
src/db.js:217
↓ 1 callers
Function
validateAndNormaliseBaseUrl
* Validate that a client-supplied base URL is safe to use as an upstream * target. Throws RelayUrlValidationError on any policy violation. * * Rul
src/providers.js:160
Function
App
()
examples/react-vite/src/App.jsx:19
Method
constructor
(message)
src/providers.js:139
Function
handleReset
()
examples/react-vite/src/App.jsx:68
Function
handleSend
(e)
examples/react-vite/src/App.jsx:82
Function
handleStoreKey
(e)
examples/react-vite/src/App.jsx:55
Function
requireAppSecret
* requireAppSecret — guards POST /users when APP_SECRET is configured. * If APP_SECRET env var is set, the caller must supply: * Authorization: Be
src/index.js:91
Function
requireToken
(req, res, next)
src/index.js:112