diff --git a/docs/data/ampli/integrating-with-ci.md b/docs/data/ampli/integrating-with-ci.md
index ebc073199..68bfb5790 100644
--- a/docs/data/ampli/integrating-with-ci.md
+++ b/docs/data/ampli/integrating-with-ci.md
@@ -4,7 +4,7 @@ description: Use Amplitude Data with your continuous integration (CI) workflow.
template: guide.html
---
-Amplitude Data works best when integrated into your continuous integration (CI) workflow, running continuously alongside your test suite. Amplitude Data integrates with all common CI providers and you can configure it for custom environments.
+Amplitude Data works best when integrated into your continuous integration (CI) workflow, running continuously alongside your test suite. Amplitude Data integrates with all common CI providers, and you can configure it for custom environments.
After you've added Amplitude Data to your CI environment, Amplitude Data verifies your analytics against every build.
diff --git a/docs/data/ampli/migration.md b/docs/data/ampli/migration.md
index 42e387351..45601c895 100644
--- a/docs/data/ampli/migration.md
+++ b/docs/data/ampli/migration.md
@@ -40,7 +40,7 @@ Start by passing your existing Amplitude SDK instance to Ampli. Ampli will use t
ampli.load({ client: { instance: amplitude }})
```
-All existing `amplitude.track('Song Played')` (a.k.a `amplitude.logEvent()`) will continue to work. However, you now also have access to strongly typed methods and types for all events for the Source in your tracking plan e.g. `ampli.songPlayed()` and `ampli.track(new SongPlayed())`.
+All existing `amplitude.track('Song Played')` (a.k.a. `amplitude.logEvent()`) will continue to work. However, you now also have access to strongly typed methods and types for all events for the Source in your tracking plan e.g. `ampli.songPlayed()` and `ampli.track(new SongPlayed())`.
#### Process
@@ -64,7 +64,7 @@ import * as amplitude, { BaseEvent } from '@amplitude/analytics-browser';
// Notice this will keep working as-is, so you can keep the
// existing implementation while progressively migrating to Ampli
-amplitude.init('API-KEY');
+amplitude.init(AMPLITUDE_API_KEY);
amplitude.add(new MyPlugin());
amplitude.setUserId('me');
amplitude.track('Song Played', { title: 'Happy Birthday'});
@@ -99,10 +99,10 @@ After all existing Amplitude SDK instrumentation has been replaced with Ampli, y
// Initialize
const sdkOptions: Options = { ... };
-- amplitude.init('API-KEY', undefined, sdkOptions);
+- amplitude.init(AMPLITUDE_API_KEY, undefined, sdkOptions);
+ ampli.load({
-+ environment: 'production',
+ client: {
++ apiKey: AMPLITUDE_API_KEY,
+ configuration: sdkOptions
+ }
+ })
@@ -178,12 +178,14 @@ amplitude.init(AMPLITUDE_API_KEY);
```typescript
import { ampli, SongPlayed } from './ampli';
-// Initialize with an Environment from Data
+// Initialize with Amplitude API Key
ampli.load({
- environment: 'my-production'
+ client: {
+ apiKey: AMPLITUDE_API_KEY
+ }
});
-// Initialize with pre-existing Amplitude SDK instance
+// Or initialize with pre-existing Amplitude SDK instance
ampli.load({
client: {
instance: amplitude,
diff --git a/docs/data/sdks/android-kotlin/ampli.md b/docs/data/sdks/android-kotlin/ampli.md
index 1828fffce..818f9e724 100644
--- a/docs/data/sdks/android-kotlin/ampli.md
+++ b/docs/data/sdks/android-kotlin/ampli.md
@@ -45,8 +45,8 @@ Amplitude Data supports tracking analytics events from Android apps written in K
import com.amplitude.ampli.*
ampli.load(appContext, LoadOptions(
- environment = Ampli.Environment.PRODUCTION
- ));
+ client = LoadClientOptions(apiKey = AMPLITUDE_API_KEY)
+ ))
```
5. [Identify users and set user properties](#identify)
@@ -111,19 +111,19 @@ Initialize Ampli in your code. The `load()` method accepts configuration option
```java
import com.amplitude.ampli.*;
- Ampli.getInstance().load(appContext, new LoadOptions()
- .setEnvironment(Ampli.Environment.PRODUCTION)
+ Ampli.getInstance().load(this, new LoadOptions()
+ .setClient(new LoadClientOptions().setApiKey(AMPLITUDE_API_KEY))
);
```
=== "Kotlin"
- ```java
+ ```kotlin
import com.amplitude.ampli.*
ampli.load(appContext, LoadOptions(
- environment = Ampli.Environment.PRODUCTION
- ));
+ client = LoadClientOptions(apiKey = AMPLITUDE_API_KEY)
+ ))
```
|
Arg
| Description |
diff --git a/docs/data/sdks/android-kotlin/index.md b/docs/data/sdks/android-kotlin/index.md
index 98005ad6f..901edf9d4 100644
--- a/docs/data/sdks/android-kotlin/index.md
+++ b/docs/data/sdks/android-kotlin/index.md
@@ -74,7 +74,7 @@ Use [this quickstart guide](../../sdks/sdk-quickstart#android) to get started wi
```java
import com.amplitude.android.Amplitude;
- Configuration configuration = new Configuration(API_KEY, getApplicationContext());
+ Configuration configuration = new Configuration(AMPLITUDE_API_KEY, getApplicationContext());
configuration.setFlushIntervalMillis(1000);
configuration.setFlushQueueSize(10);
@@ -103,7 +103,7 @@ You can dynamically set the configuration after initialization.
```java
import com.amplitude.android.Amplitude;
- Configuration configuration = new Configuration(API_KEY, getApplicationContext());
+ Configuration configuration = new Configuration(AMPLITUDE_API_KEY, getApplicationContext());
Amplitude amplitude = new Amplitude(configuration);
amplitude.getConfiguration().setOptOut(true);
@@ -118,7 +118,7 @@ You can dynamically set the configuration after initialization.
val amplitude = Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
serverZone = ServerZone.EU
)
@@ -130,7 +130,7 @@ You can dynamically set the configuration after initialization.
```java
import com.amplitude.android.Amplitude;
- Configuration configuration = new Configuration("API_KEY", getApplicationContext());
+ Configuration configuration = new Configuration(AMPLITUDE_API_KEY, getApplicationContext());
configuration.setServerZone(ServerZone.EU);
Amplitude amplitude = new Amplitude(configuration);
@@ -207,7 +207,7 @@ You can enable Amplitude to start tracking all events mentioned above, use the c
```kotlin
Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
defaultTracking = DefaultTrackingOptions.ALL
)
@@ -222,7 +222,7 @@ Similarly, you can disable Amplitude to track all events mentioned above with th
```kotlin
Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
defaultTracking = DefaultTrackingOptions.NONE
)
@@ -234,7 +234,7 @@ You can also customize the tracking with `DefaultTrackingOptions`, see code samp
```kotlin
Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
defaultTracking = DefaultTrackingOptions(
appLifecycles = true,
@@ -253,7 +253,7 @@ You can enable Amplitude to start tracking session events by setting `configurat
```kotlin
Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
defaultTracking = DefaultTrackingOptions(
sessions = true
@@ -274,7 +274,7 @@ You can enable Amplitude to start tracking application lifecycle events by setti
```kotlin
Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
defaultTracking = DefaultTrackingOptions(
appLifecycles = true
@@ -297,7 +297,7 @@ You can enable Amplitude to start tracking screen view events by setting `config
```kotlin
Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
defaultTracking = DefaultTrackingOptions(
screenViews = true
@@ -315,7 +315,7 @@ You can enable Amplitude to start tracking deep link events by setting `configur
```kotlin
Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
defaultTracking = DefaultTrackingOptions(
deepLinks = true
@@ -553,7 +553,7 @@ You can adjust the time window for which sessions are extended. The default sess
```kotlin
amplitude = Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
minTimeBetweenSessionsMillis = 10000
)
@@ -563,7 +563,7 @@ You can adjust the time window for which sessions are extended. The default sess
=== "Java"
```java
- Configuration configuration = new Configuration(API_KEY, getApplicationContext());
+ Configuration configuration = new Configuration(AMPLITUDE_API_KEY, getApplicationContext());
configuration.setMinTimeBetweenSessionsMillis(1000);
Amplitude amplitude = new Amplitude(configuration);
@@ -577,7 +577,7 @@ You can also disable those session events.
```kotlin
amplitude = Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
defaultTracking = DefaultTrackingOptions(
sessions = false
@@ -591,7 +591,7 @@ You can also disable those session events.
```
defaultTrackingOptions = new DefaultTrackingOptions();
defaultTrackingOptions.setSessions(false);
- amplitude = AmplitudeKt.Amplitude(API_KEY, getApplicationContext(), configuration -> {
+ amplitude = AmplitudeKt.Amplitude(AMPLITUDE_API_KEY, getApplicationContext(), configuration -> {
configuration.setDefaultTracking(defaultTrackingOptions);
return Unit.INSTANCE;
});
@@ -618,7 +618,7 @@ You can define your own session expiration time. The default session expiration
```kotlin
amplitude = Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
minTimeBetweenSessionsMillis = 10000
)
@@ -628,7 +628,7 @@ You can define your own session expiration time. The default session expiration
=== "Java"
```java
- Configuration configuration = new Configuration(API_KEY, getApplicationContext());
+ Configuration configuration = new Configuration(AMPLITUDE_API_KEY, getApplicationContext());
configuration.setMinTimeBetweenSessionsMillis(10000);
Amplitude amplitude = new Amplitude(configuration);
@@ -720,7 +720,7 @@ Before initializing the SDK with your apiKey, create a `TrackingOptions` insta
trackingOptions.disableCity().disableIpAddress().disableLatLng()
amplitude = Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
trackingOptions = trackingOptions
)
@@ -734,7 +734,7 @@ Before initializing the SDK with your apiKey, create a `TrackingOptions` insta
trackingOptions.disableCity().disableIpAddress().disableLatLng();
// init instance
- amplitude = AmplitudeKt.Amplitude(API_KEY, getApplicationContext(), configuration -> {
+ amplitude = AmplitudeKt.Amplitude(AMPLITUDE_API_KEY, getApplicationContext(), configuration -> {
configuration.setTrackingOptions(trackingOptions);
return Unit.INSTANCE;
});
@@ -777,7 +777,7 @@ COPPA (Children's Online Privacy Protection Act) restrictions on IDFA, IDFV, cit
```kotlin
amplitude = Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
enableCoppaControl = true //Disables ADID, city, IP, and location tracking
)
@@ -787,7 +787,7 @@ COPPA (Children's Online Privacy Protection Act) restrictions on IDFA, IDFV, cit
=== "Java"
```java
- Configuration configuration = new Configuration(API_KEY, getApplicationContext());
+ Configuration configuration = new Configuration(AMPLITUDE_API_KEY, getApplicationContext());
//Disables ADID, city, IP, and location tracking
configuration.setEnableCoppaControl(true);
@@ -807,7 +807,7 @@ After you set up the logic to fetch the advertising ID, you can enable `useAdver
```kotlin
amplitude = Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
useAdvertisingIdForDeviceId = true
)
@@ -817,7 +817,7 @@ After you set up the logic to fetch the advertising ID, you can enable `useAdver
=== "Java"
```java
- Configuration configuration = new Configuration(API_KEY, getApplicationContext());
+ Configuration configuration = new Configuration(AMPLITUDE_API_KEY, getApplicationContext());
configuration.setUseAdvertisingIdForDeviceId(true);
Amplitude amplitude = new Amplitude(configuration);
@@ -845,7 +845,7 @@ App set ID is a unique identifier for each app install on a device. App set ID i
```kotlin
amplitude = Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
useAppSetIdForDeviceId = true
)
@@ -855,7 +855,7 @@ App set ID is a unique identifier for each app install on a device. App set ID i
=== "Java"
```java
- Configuration configuration = new Configuration(API_KEY, getApplicationContext());
+ Configuration configuration = new Configuration(AMPLITUDE_API_KEY, getApplicationContext());
configuration.setUseAppSetIdForDeviceId(true);
Amplitude amplitude = new Amplitude(configuration);
@@ -895,7 +895,7 @@ By default, Amplitude can use Android location service (if available) to add the
```kotlin
amplitude = Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
locationListening = true
)
@@ -905,7 +905,7 @@ By default, Amplitude can use Android location service (if available) to add the
=== "Java"
```java
- Configuration configuration = new Configuration("API_KEY", getApplicationContext());
+ Configuration configuration = new Configuration(AMPLITUDE_API_KEY, getApplicationContext());
configuration.setLocationListening(true);
Amplitude amplitude = new Amplitude(configuration);
@@ -924,7 +924,7 @@ Users may wish to opt out of tracking entirely, which means Amplitude doesn't tr
```kotlin
amplitude = Amplitude(
Configuration(
- apiKey = API_KEY,
+ apiKey = AMPLITUDE_API_KEY,
context = applicationContext,
optOut = true
)
@@ -934,7 +934,7 @@ Users may wish to opt out of tracking entirely, which means Amplitude doesn't tr
=== "Java"
```java
- Configuration configuration = new Configuration(API_KEY, getApplicationContext());
+ Configuration configuration = new Configuration(AMPLITUDE_API_KEY, getApplicationContext());
configuration.setOptOut(true);
Amplitude amplitude = new Amplitude(configuration);
diff --git a/docs/data/sdks/android/ampli.md b/docs/data/sdks/android/ampli.md
index 70fac5360..1b5755a97 100644
--- a/docs/data/sdks/android/ampli.md
+++ b/docs/data/sdks/android/ampli.md
@@ -45,8 +45,8 @@ Amplitude Data supports tracking analytics events from Android apps written in K
import com.amplitude.ampli.*
ampli.load(appContext, LoadOptions(
- environment = Ampli.Environment.PRODUCTION
- ));
+ client = LoadClientOptions(apiKey = AMPLITUDE_API_KEY)
+ ))
```
5. [Identify users and set user properties](#identify)
@@ -113,19 +113,19 @@ Initialize Ampli in your code. The `load()` method accepts configuration option
```java
import com.amplitude.ampli.*;
- Ampli.getInstance().load(appContext, new LoadOptions()
- .setEnvironment(Ampli.Environment.PRODUCTION)
+ Ampli.getInstance().load(this, new LoadOptions()
+ .setClient(new LoadClientOptions().setApiKey(AMPLITUDE_API_KEY))
);
```
=== "Kotlin"
- ```java
+ ```kotlin
import com.amplitude.ampli.*
ampli.load(appContext, LoadOptions(
- environment = Ampli.Environment.PRODUCTION
- ));
+ client = LoadClientOptions(apiKey = AMPLITUDE_API_KEY)
+ ))
```
| Arg
| Description |
diff --git a/docs/data/sdks/android/index.md b/docs/data/sdks/android/index.md
index 4a5731bd2..fefff23ae 100644
--- a/docs/data/sdks/android/index.md
+++ b/docs/data/sdks/android/index.md
@@ -65,7 +65,7 @@ After you've installed the SDK and its dependencies, import Amplitude into any f
// initialize
AmplitudeClient client = Amplitude.getInstance()
- .initialize(getApplicationContext(), "YOUR_API_KEY_HERE")
+ .initialize(getApplicationContext(), AMPLITUDE_API_KEY)
.enableForegroundTracking(getApplication());
// send an event
@@ -89,7 +89,7 @@ After you've installed the SDK and its dependencies, import Amplitude into any f
// initialize
val client = Amplitude.getInstance()
- .initialize(getApplicationContext(), "YOUR_API_KEY_HERE")
+ .initialize(getApplicationContext(), AMPLITUDE_API_KEY)
.enableForegroundTracking(application)
// send event
@@ -122,7 +122,7 @@ Accurate session tracking requires that you enable `enableForegroundTracking(ge
```java
AmplitudeClient client = Amplitude.getInstance()
- .initialize(getApplicationContext(), "YOUR_API_KEY_HERE")
+ .initialize(getApplicationContext(), AMPLITUDE_API_KEY)
.enableForegroundTracking(getApplication());
```
@@ -130,7 +130,7 @@ Accurate session tracking requires that you enable `enableForegroundTracking(ge
```kotlin
val client = Amplitude.getInstance()
- .initialize(getApplicationContext(), "YOUR_API_KEY_HERE")
+ .initialize(getApplicationContext(), AMPLITUDE_API_KEY)
.enableForegroundTracking(application)
```
@@ -1007,7 +1007,6 @@ App set ID is a unique identifier for each app install on a device. App set ID i
client.setDeviceId("DEVICE-ID");
```
-
### Location tracking
Amplitude converts the IP of a user event into a location (GeoIP lookup) by default. This information may be overridden by an app's own tracking solution or user data.
diff --git a/docs/data/sdks/browser-2/index.md b/docs/data/sdks/browser-2/index.md
index 4e5199e0f..2a95a4380 100644
--- a/docs/data/sdks/browser-2/index.md
+++ b/docs/data/sdks/browser-2/index.md
@@ -31,17 +31,17 @@ Use [this quickstart guide](../sdk-quickstart#browser) to get started with Ampli
--8<-- "includes/sdk-ts-browser/init.md"
```ts
-// Option 1, initialize with API_KEY only
-amplitude.init(API_KEY);
+// Option 1, initialize with Amplitude API key only
+amplitude.init(AMPLITUDE_API_KEY);
// Option 2, initialize with options
-amplitude.init(API_KEY, options);
+amplitude.init(AMPLITUDE_API_KEY, options);
// Option 3, initialize with user ID if it's already known
-amplitude.init(API_KEY, 'user@amplitude.com');
+amplitude.init(AMPLITUDE_API_KEY, 'user@amplitude.com');
// Option 4, initialize with a user ID and options
-amplitude.init(API_KEY, 'user@amplitude.com', options);
+amplitude.init(AMPLITUDE_API_KEY, 'user@amplitude.com', options);
```
### Configuration
@@ -70,7 +70,7 @@ amplitude.init(API_KEY, 'user@amplitude.com', options);
--8<-- "includes/sdk-quickstart/quickstart-eu-data-residency.md"
```ts
-amplitude.init(API_KEY, {
+amplitude.init(AMPLITUDE_API_KEY, {
serverZone: 'EU',
});
```
@@ -88,7 +88,7 @@ You can control the level of logs printed to the developer console.
Set the log level by configuring the `logLevel` with the level you want.
```ts
-amplitude.init(API_KEY, {
+amplitude.init(AMPLITUDE_API_KEY, {
logLevel: amplitude.Types.LogLevel.Warn,
});
```
@@ -98,7 +98,7 @@ The default logger outputs log to the developer console. You can provide your ow
Set the logger by configuring the `loggerProvider` with your own implementation.
```ts
-amplitude.init(API_KEY, {
+amplitude.init(AMPLITUDE_API_KEY, {
loggerProvider: new MyLogger(),
});
```
@@ -108,7 +108,7 @@ amplitude.init(API_KEY, {
Enable the debug mode by setting the `logLevel` to "Debug", for example:
```ts
-amplitude.init(API_KEY, {
+amplitude.init(AMPLITUDE_API_KEY, {
logLevel: amplitude.Types.LogLevel.Debug,
});
```
@@ -165,7 +165,7 @@ Starting version 1.9.1, Browser SDK now tracks default events. Browser SDK can b
To opt-out, refer to the code below. Otherwise, you can omit the configuration to keep them enabled.
```ts
-amplitude.init(API_KEY, {
+amplitude.init(AMPLITUDE_API_KEY, {
defaultTracking: {
attribution: false,
pageViews: false,
@@ -179,7 +179,7 @@ amplitude.init(API_KEY, {
Alternatively, you can disable Amplitude from tracking all events mentioned above (and future default events) by setting `config.defaultTracking` to `false`.
```ts
-amplitude.init(API_KEY, {
+amplitude.init(AMPLITUDE_API_KEY, {
defaultTracking: false,
});
```
@@ -194,7 +194,7 @@ Amplitude marketing attribution by default by tracking UTM, referrers and click
You can opt out of marketing attribution tracking by setting `config.defaultTracking.attribution` to `false`. Refer to the code sample below.
```ts
-amplitude.init(API_KEY, {
+amplitude.init(AMPLITUDE_API_KEY, {
defaultTracking: {
attribution: false,
},
@@ -215,7 +215,7 @@ You can also use advanced configuration for better control of how marketing attr
For example, you can configure Amplitude to track marketing attribution separately for each of your subdomains. Refer to the code sample for how to achieve this.
```ts
-amplitude.init(API_KEY, {
+amplitude.init(AMPLITUDE_API_KEY, {
defaultTracking: {
attribution: {
excludeReferrers: [location.hostname],
@@ -231,7 +231,7 @@ Amplitude tracks page view events by default. The default behavior sends a page
You can opt out of page view tracking by setting `config.defaultTracking.pageViews` to `false`. Refer to the code sample below.
```ts
-amplitude.init(API_KEY, {
+amplitude.init(AMPLITUDE_API_KEY, {
defaultTracking: {
pageViews: false,
},
@@ -249,7 +249,7 @@ Amplitude tracks session events by default. A session is the period of time a us
You can opt out of session tracking by setting `config.defaultTracking.sessions` to `false`. Refer to the code sample below.
```ts
-amplitude.init(API_KEY, {
+amplitude.init(AMPLITUDE_API_KEY, {
defaultTracking: {
sessions: false,
},
@@ -272,7 +272,7 @@ Amplitude can track forms that are constructed with `