@@ -46,7 +46,8 @@ import com.withorb.api.client.okhttp.OrbOkHttpClient;
4646import com.withorb.api.models.Customer ;
4747import com.withorb.api.models.CustomerCreateParams ;
4848
49- // Configures using the `ORB_API_KEY`, `ORB_WEBHOOK_SECRET` and `ORB_BASE_URL` environment variables
49+ // Configures using the `orb.apiKey`, `orb.webhookSecret` and `orb.baseUrl` system properties
50+ // Or configures using the `ORB_API_KEY`, `ORB_WEBHOOK_SECRET` and `ORB_BASE_URL` environment variables
5051OrbClient client = OrbOkHttpClient . fromEnv();
5152
5253CustomerCreateParams params = CustomerCreateParams . builder()
@@ -58,13 +59,14 @@ Customer customer = client.customers().create(params);
5859
5960## Client configuration
6061
61- Configure the client using environment variables:
62+ Configure the client using system properties or environment variables:
6263
6364``` java
6465import com.withorb.api.client.OrbClient ;
6566import com.withorb.api.client.okhttp.OrbOkHttpClient ;
6667
67- // Configures using the `ORB_API_KEY`, `ORB_WEBHOOK_SECRET` and `ORB_BASE_URL` environment variables
68+ // Configures using the `orb.apiKey`, `orb.webhookSecret` and `orb.baseUrl` system properties
69+ // Or configures using the `ORB_API_KEY`, `ORB_WEBHOOK_SECRET` and `ORB_BASE_URL` environment variables
6870OrbClient client = OrbOkHttpClient . fromEnv();
6971```
7072
@@ -86,19 +88,22 @@ import com.withorb.api.client.OrbClient;
8688import com.withorb.api.client.okhttp.OrbOkHttpClient ;
8789
8890OrbClient client = OrbOkHttpClient . builder()
89- // Configures using the `ORB_API_KEY`, `ORB_WEBHOOK_SECRET` and `ORB_BASE_URL` environment variables
91+ // Configures using the `orb.apiKey`, `orb.webhookSecret` and `orb.baseUrl` system properties
92+ Or configures using the `ORB_API_KEY `, `ORB_WEBHOOK_SECRET ` and `ORB_BASE_URL ` environment variables
9093 .fromEnv()
9194 .apiKey(" My API Key" )
9295 .build();
9396```
9497
9598See this table for the available options:
9699
97- | Setter | Environment variable | Required | Default value |
98- | --------------- | -------------------- | -------- | ------------------------------ |
99- | ` apiKey ` | ` ORB_API_KEY ` | true | - |
100- | ` webhookSecret ` | ` ORB_WEBHOOK_SECRET ` | false | - |
101- | ` baseUrl ` | ` ORB_BASE_URL ` | true | ` "https://api.withorb.com/v1" ` |
100+ | Setter | System property | Environment variable | Required | Default value |
101+ | --------------- | ------------------- | -------------------- | -------- | ------------------------------ |
102+ | ` apiKey ` | ` orb.apiKey ` | ` ORB_API_KEY ` | true | - |
103+ | ` webhookSecret ` | ` orb.webhookSecret ` | ` ORB_WEBHOOK_SECRET ` | false | - |
104+ | ` baseUrl ` | ` orb.baseUrl ` | ` ORB_BASE_URL ` | true | ` "https://api.withorb.com/v1" ` |
105+
106+ System properties take precedence over environment variables.
102107
103108> [ !TIP]
104109> Don't create more than one client in the same application. Each client has a connection pool and
@@ -144,7 +149,8 @@ import com.withorb.api.models.Customer;
144149import com.withorb.api.models.CustomerCreateParams ;
145150import java.util.concurrent.CompletableFuture ;
146151
147- // Configures using the `ORB_API_KEY`, `ORB_WEBHOOK_SECRET` and `ORB_BASE_URL` environment variables
152+ // Configures using the `orb.apiKey`, `orb.webhookSecret` and `orb.baseUrl` system properties
153+ // Or configures using the `ORB_API_KEY`, `ORB_WEBHOOK_SECRET` and `ORB_BASE_URL` environment variables
148154OrbClient client = OrbOkHttpClient . fromEnv();
149155
150156CustomerCreateParams params = CustomerCreateParams . builder()
@@ -163,7 +169,8 @@ import com.withorb.api.models.Customer;
163169import com.withorb.api.models.CustomerCreateParams ;
164170import java.util.concurrent.CompletableFuture ;
165171
166- // Configures using the `ORB_API_KEY`, `ORB_WEBHOOK_SECRET` and `ORB_BASE_URL` environment variables
172+ // Configures using the `orb.apiKey`, `orb.webhookSecret` and `orb.baseUrl` system properties
173+ // Or configures using the `ORB_API_KEY`, `ORB_WEBHOOK_SECRET` and `ORB_BASE_URL` environment variables
167174OrbClientAsync client = OrbOkHttpClientAsync . fromEnv();
168175
169176CustomerCreateParams params = CustomerCreateParams . builder()
0 commit comments