It’s recommended to use the Kotlin API client, which is better suited for Android development.
We released a new version of the JavaScript API client in public beta.
Read the beta documentation for more information.
We released a new version of the PHP API client in public beta.
Read the beta documentation for more information.
We released a new version of the Java API client in public beta.
Read the beta documentation for more information.
Personalization region
Your Personalization data is stored and processed in a specific region: either in Europe (Germany), or in the United States.
When initializing the Personalization client, you need to select your analytics region:
1
2
3
4
5
6
7
8
9
10
11
12
| <?php
// Installation instructions:
// https://www.algolia.com/doc/api-client/getting-started/install/
require_once __DIR__."/vendor/autoload.php";
use Algolia\AlgoliaSearch\PersonalizationClient;
// You need an API key with `editSettings` permission
$personalization = PersonalizationClient::create(
'YourApplicationID',
'YourWriteAPIKey',
'eu' // Default: 'us'
);
|
1
2
3
4
5
6
7
8
9
10
| # Installation instructions:
# https://www.algolia.com/doc/api-client/getting-started/install/
require 'algolia'
# You need an API key with `editSettings` permission
personalization = Algolia::Personalization::Client.create(
'YourApplicationID',
'YourAPIKey',
'eu', # Default: 'us'
)
|
1
2
3
4
5
6
7
8
9
10
| // Installation instructions:
// https://www.algolia.com/doc/api-client/getting-started/install/
const algoliasearch = require('algoliasearch');
// You need an API key with `editSettings` permission
const client = algoliasearch('YourApplicationID', 'YourAPIKey');
const personalization = client.initPersonalization{
region: 'eu' // Default: 'us'
});
|
1
2
3
4
5
6
7
8
9
| # Installation instructions:
# https://www.algolia.com/doc/api-client/getting-started/install/
from algoliasearch.personalization_client import PersonalizationClient
personalization = PersonalizationClient.create(
'YourApplicationID',
'YourWriteAPIKey',
'eu', # Default: 'us'
)
|
1
2
3
4
5
6
7
8
9
10
| // Installation instructions:
// https://www.algolia.com/doc/api-client/getting-started/install/
import AlgoliaSearchClient
// You need an API key with `editSettings` permissions
let client = PersonalizationClient(
appID: "YourApplicationID",
apiKey: "YourWriteAPIKey",
region: .us
)
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| // Installation instructions:
// https://www.algolia.com/doc/api-client/getting-started/install/
import com.algolia.search.model.APIKey
import com.algolia.search.model.ApplicationID
import com.algolia.search.client.ClientPersonalization
import com.algolia.search.configuration.Region.Personalization.EU
// import com.algolia.search.configuration.Region.Personalization.US
suspend fun main() {
// You need an API key with `editSettings` permission
val client = ClientPersonalization(
applicationID = ApplicationID("YourApplicationID"),
apiKey = APIKey("YourAPIKey"),
region = EU // Default: US
)
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| // Installation instructions:
// https://www.algolia.com/doc/api-client/getting-started/install/
using Algolia.Search.Clients;
// You need an API key with `editSettings` permission
class Program
{
public static void Main(string[] args)
{
var client = new PersonalizationClient(
"YourApplicationID",
"YourAPIKey",
"eu" // Default: US
);
}
}
|
1
2
3
4
5
6
7
8
9
10
| // Installation instructions:
// https://www.algolia.com/doc/api-client/getting-started/install/
import com.algolia.search.DefaultPersonalizationClient;
import com.algolia.search.PersonalizationClient;
public class Program {
public static void main(String[] args) {
// You need an API key with `editSettings` permissions
PersonalizationClient client = DefaultPersonalizationClient.create("YourApplicationID", "YourAPIKey", "eu");
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| // Installation instructions:
// https://www.algolia.com/doc/api-client/getting-started/install/
package main
import (
"github.com/algolia/algoliasearch-client-go/v3/algolia/personalization"
"github.com/algolia/algoliasearch-client-go/v3/algolia/region"
)
func main (
client := personalization.NewClientWithConfig(
personalization.Configuration {
AppID: "YourApplicationID",
APIKey: "YourAPIKey",
Region: region.EU, // Default: region.US
}
)
)
|
1
2
3
4
5
6
7
8
9
10
11
| // Installation instructions:
// https://www.algolia.com/doc/api-client/getting-started/install/
package org.example
import algolia.AlgoliaClient
object Program extends App {
// You need an API key with `editSettings` permission
val client = new AlgoliaClient("YourApplicationID", "YourAPIKey")
client.personalizationHost = "https://personalization.eu.algolia.com"
}
|
You can check the region for your account in the Algolia dashboard.