Skip to main content

Getting started

In this section we will show you how to integrate the Partium Find SDK into your application.

SDK Installation

The Partium Find SDK supports multiple integration types and can be integrated into any JavaScript-based projects. You can download the package compatible with your current framework using the links below:

Package installation

Before you can install the Partium Find SDK, make sure you have npm installed.

Now you can install the Partium Find SDK package:

npm install @partium/js-sdk

You have successfully installed the Partium Find SDK. Before you can trigger your first search, you need to initialize the SDK with an API-key.

SDK initialization

To use the Partium Find SDK, you need to first initialize it:

import { Partium } from '@partium/js-sdk';

...

Partium.initApiKey('<API-KEY>');

API-KEYs can be generated and managed in the API Keys section.

Everything is ready for your first search. Let's start with a simple text-search:

Partium.search.performSearch(
{
organizationName: '<organization-name>', // e.g.: 'Partium' (get this from your Partium contact person)
searchLanguage: '<search-language-code>', // e.g.: 'en'
text: 'valve',
}
).subscribe((result: SearchOutput) => {
// search successful, find results in result.searchResults
}, (error: SdkError) => {
// an error happened during the search
});

The search also allows to add multiple search-inputs at once. These searches are called multi-modal searches. In the following example, we combine text-search with attribute filter search:

Partium.search.performSearch(
{
organizationName: '<organization-name>', // e.g.: 'Partium'
searchLanguage: '<search-language-code>', // e.g.: 'en'
text: 'valve',
attributeFilters: {
['Color']: ['Red', 'Blue', ...], // replace with filter that is supported in your data
},
}
).subscribe((result: SearchOutput) => {
// search successful, find results in result.searchResults
}, (error: SdkError) => {
// an error happened during the search
});