@@ -51,7 +51,8 @@ import com.lithic.api.client.okhttp.LithicOkHttpClient;
5151import com.lithic.api.models.Card ;
5252import com.lithic.api.models.CardCreateParams ;
5353
54- // Configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables
54+ // Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties
55+ // Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables
5556LithicClient client = LithicOkHttpClient . fromEnv();
5657
5758CardCreateParams params = CardCreateParams . builder()
@@ -62,13 +63,14 @@ Card card = client.cards().create(params);
6263
6364## Client configuration
6465
65- Configure the client using environment variables:
66+ Configure the client using system properties or environment variables:
6667
6768``` java
6869import com.lithic.api.client.LithicClient ;
6970import com.lithic.api.client.okhttp.LithicOkHttpClient ;
7071
71- // Configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables
72+ // Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties
73+ // Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables
7274LithicClient client = LithicOkHttpClient . fromEnv();
7375```
7476
@@ -90,19 +92,22 @@ import com.lithic.api.client.LithicClient;
9092import com.lithic.api.client.okhttp.LithicOkHttpClient ;
9193
9294LithicClient client = LithicOkHttpClient . builder()
93- // Configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables
95+ // Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties
96+ Or configures using the `LITHIC_API_KEY `, `LITHIC_WEBHOOK_SECRET ` and `LITHIC_BASE_URL ` environment variables
9497 .fromEnv()
9598 .apiKey(" My Lithic API Key" )
9699 .build();
97100```
98101
99102See this table for the available options:
100103
101- | Setter | Environment variable | Required | Default value |
102- | --------------- | ----------------------- | -------- | -------------------------- |
103- | ` apiKey ` | ` LITHIC_API_KEY ` | true | - |
104- | ` webhookSecret ` | ` LITHIC_WEBHOOK_SECRET ` | false | - |
105- | ` baseUrl ` | ` LITHIC_BASE_URL ` | true | ` "https://api.lithic.com" ` |
104+ | Setter | System property | Environment variable | Required | Default value |
105+ | --------------- | ---------------------- | ----------------------- | -------- | -------------------------- |
106+ | ` apiKey ` | ` lithic.apiKey ` | ` LITHIC_API_KEY ` | true | - |
107+ | ` webhookSecret ` | ` lithic.webhookSecret ` | ` LITHIC_WEBHOOK_SECRET ` | false | - |
108+ | ` baseUrl ` | ` lithic.baseUrl ` | ` LITHIC_BASE_URL ` | true | ` "https://api.lithic.com" ` |
109+
110+ System properties take precedence over environment variables.
106111
107112> [ !TIP]
108113> Don't create more than one client in the same application. Each client has a connection pool and
@@ -148,7 +153,8 @@ import com.lithic.api.models.Card;
148153import com.lithic.api.models.CardCreateParams ;
149154import java.util.concurrent.CompletableFuture ;
150155
151- // Configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables
156+ // Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties
157+ // Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables
152158LithicClient client = LithicOkHttpClient . fromEnv();
153159
154160CardCreateParams params = CardCreateParams . builder()
@@ -166,7 +172,8 @@ import com.lithic.api.models.Card;
166172import com.lithic.api.models.CardCreateParams ;
167173import java.util.concurrent.CompletableFuture ;
168174
169- // Configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables
175+ // Configures using the `lithic.apiKey`, `lithic.webhookSecret` and `lithic.baseUrl` system properties
176+ // Or configures using the `LITHIC_API_KEY`, `LITHIC_WEBHOOK_SECRET` and `LITHIC_BASE_URL` environment variables
170177LithicClientAsync client = LithicOkHttpClientAsync . fromEnv();
171178
172179CardCreateParams params = CardCreateParams . builder()
0 commit comments