Comments (4)
Is the indexName everywhere profiles
? does algoliasearchkey
have access to that index as well? Does it work if you use a different api key?
from vue-instantsearch.
Thanks, so "profiles" is the index name everywhere. algoliasearchkey
is only the API key value. It works when I use a dashboard generated API key. Otherwise the way I generate the key for each user is through a cloud function in Firebase. This is how I do it in my cloud functions:
//generate a key for each new signed-up user, then add it to the user document
const algoliasearch = require('algoliasearch');
const client = algoliasearch('xxxxxxxxx', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
const index = client.initIndex('profiles');
exports.generateAndAddAlgoliaApiKeyToUser = functions.firestore
.document('users/{user}')
.onCreate((snap, context) => {
console.error("On Create triggered")
const userid = snap.id
console.log('the id of the new user id : ' + userid)
const publicKey = client.generateSecuredApiKey(
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', // A search key that you keep private
{
filters: `owninguser:${userid}`
}
);
console.log("this is the new key: " + publicKey)
db.doc('users/' + snap.id).update({
algoliasearchkey: publicKey,
});
I realise I don't use the index variable in the function. Is this what causes the key not to work?
from vue-instantsearch.
https://www.algolia.com/doc/api-reference/api-methods/generate-secured-api-key/
This is the guide I used to create the key generation function. I don't see any obligation to specify an index. I just restrict the search for each user with a filter.
from vue-instantsearch.
No, this all should work. As it's a question unrelated to InstantSearch as far as I can tell, I suggest you contact [email protected] describing your issue. I don't know what the cause could be, sorry!
from vue-instantsearch.
Related Issues (20)
- Vue - Lag Typing (Meili Search) HOT 5
- Trailing Slash HOT 2
- Is SSR support for Nuxt 3 planned ? HOT 5
- ais-Pagination-item--page not working
- Problem with test createServerRootMixin with Jest HOT 2
- [v3.8.1] AisHierarchicalMenu CreateURL generates different URL when selected vs deselected - can hurt SEO crawlers. HOT 4
- Voice search language option HOT 2
- clears-query Feature in currentRefinements HOT 2
- ais-hierarchical-menu with dynamic rootPath prop HOT 3
- History router doesn't load all previous pages HOT 1
- Nuxt error using serverPrefetch with findResultsState HOT 3
- Issue : βlostβ characters when typing fast HOT 5
- Problem with ais-range-slider FACET STATS HOT 2
- <ais-instant-search :on-state-change: function /> is not implemented HOT 1
- ais-state-results component doesn't work with SSR HOT 6
- How to access Hits data directly to store it in Vuex? HOT 2
- Algolia component testing - VueInstantSearch HOT 1
- How to prevent InstantSearch from loading the initial hits before query? HOT 1
- "Failed to resolve module specifier" when using esmodules HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-instantsearch.