Force public API key to have certain search critera

Hi All,

I am new to Algolia and am wondering if there is any way to specifiy the public API key to meet a certain search criteria. My example is this…

{
    "objectId": "1",
    "isActive": true,
    "name": "test",
    // ...etc
}

I want to have the component on the website search via the public API key, although I do not want users to have access to search non active items.

Any help would be appreciated!

Hi there,

Did you have a look at the secured api keys? https://www.algolia.com/doc/guides/security/api-keys/#secured-api-keys

It can help you restrict search from the users and increase security.

Best,

The link seems to show a Javascript example. How can you do this using the Rails or Ruby gem?

You can find it here: https://www.algolia.com/doc/api-reference/api-methods/generate-secured-api-key/#having-one-api-key-per-user