How to use the angular-instantsearch.createSSRSearchClient function in angular-instantsearch

To help you get started, we’ve selected a few angular-instantsearch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github algolia / angular-instantsearch / examples / server-side-rendering / src / app / app.component.ts View on Github external
private httpClient: HttpClient,
    private transferState: TransferState,
    private injector: Injector,
    @Inject(PLATFORM_ID) private platformId: Object
  ) {
    const req = isPlatformServer(this.platformId)
      ? this.injector.get('request')
      : undefined;

    const searchParameters = parseServerRequest(req);

    this.instantsearchConfig = {
      searchParameters,
      indexName: 'instant_search',
      urlSync: true,
      searchClient: createSSRSearchClient({
        makeStateKey,
        HttpHeaders,
        appId: 'latency',
        apiKey: '6be0576ff61c053d5f9a3225e2a90f76',
        transferState: this.transferState,
        httpClient: this.httpClient,
      }),
    };
  }
}

angular-instantsearch

Lightning-fast search for Angular apps, by Algolia.

MIT
Latest version published 4 months ago

Package Health Score

56 / 100
Full package analysis