Change Profile API Key dynamically
This method changes a Profile (formerly Client) API key dynamically.
Method name:
Client.changeApiKey(newApiKey)
Declaration:
public static void changeApiKey(@NonNull String newApiKey)
fun changeApiKey(@NonNull newApiKey:String)
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| newApiKey | String | yes | - | New API Key |
Return Value:
Void type method.
Example:
Client.changeApiKey(apiKey);
Client.changeApiKey(apiKey);
Change Profile API Key dynamically with config
This method changes a Profile (formerly Client) API key dynamically, with additional parameters. It can include a salt for Simple Profile Authentication requests.
| iOS SDK | Android SDK | React Native SDK | Flutter SDK | |
|---|---|---|---|---|
| Introduced in: | 4.19.0 | 5.20.0 | 0.23.0 | 1.3.0 |
| Method name: | ||||
| Client.changeApiKey(apiKey, initializationConfig) |
Declaration:
public static void changeApiKey(String apiKey, InitializationConfig initializationConfig)
fun changeApiKey(@NonNull apiKey:String, @Nullable initializationConfig:InitializationConfig)
Parameters:
| Parameter | Type | Mandatory | Default | Description |
|---|---|---|---|---|
| apiKey | String | yes | - | New API Key |
| initializationConfig | InitializationConfig | no | - | Object for additional initialization settings after the API key change |
Return Value:
Void type method.
Example:
Client.changeApiKey(apiKey, initializationConfig);
Client.changeApiKey(apiKey, initializationConfig);