Hey all, long time. It's been a couple of months s...
# community-help
j
Hey all, long time. It's been a couple of months since I last hacked on top of Typesense. Upgraded the js client to see if it resolved a minor issue I was spotting in js client v0.14.0 (API key was appearing in query string even with the respective config set to
false
) My app broke 😅. The cause a breaking change in the client lib API introduced in v1.0.0-3. Seems like this change. I'm unblocked now but thought I'd share some details and check if I'm missing somewhere that tracks the js client API changes? it doesn't seen to mirror what on the docs site. Since then
collection('mycollectionname').retrieve()
returns a different type. It used to return as per the docs here. I'm using the
SearchClient
and accessing the
num_documents
property. In the PR I see references to a SearchOnlyCollection. I've not managed to find docs for this type. Am I missing something?
re: api key passed in the query string on js client v1.1.3-0 it's still doing it. In code I see the default is supposed to be
false
. Even when the client instantiation config has
sendApiKeyAsQueryParam: false,
j
@Janaka Abeywardhana
SearchClient
does not expose a
collection('name').retrieve()
method. It is meant to only allow searches on documents. If you use
Client
instead, you should see
num_documents
like this:
re: API Key, looks like in the SearchClient we force sending the API key as a query param and ignore the configuration: https://github.com/typesense/typesense-js/blob/a21d4101bc21fe59e0e85b41e64ba14d6fe88667/src/Typesense/SearchClient.ts#L14-L17 That almost sounds like a bug... Could you open a Github issue for this? I think we should respect the config passed into the config
j
Can you expand on "only search on documents" pls? In contrast to?
j
In contrast to allowing all operations on collections like retrieve
SearchClient is intended to only be used for search in say the browser to reduce bundle size. Client has all the methods that Typesense supports
j
gotcha. makes sense. sorry, was a slightly silly question to ask.
Created an GH issue for
sendApiKeyAsQueryParam
🙏
👍 1