/** * Creates a client with a custom service to provide access tokens. * @param config the configuration to use the API * @param tokenSupplier a service which provides tokens * @return client */ public SphereClient createClient(final SphereApiConfig config, final SphereAccessTokenSupplier tokenSupplier) { return SphereClient.of(config, defaultHttpClient(), tokenSupplier); }
/** * Creates a standard client with configurable service URLs. Intended for commercetools staff * developing with a custom SPHERE.IO instance. * * @param config configuration for the client * @return client */ public SphereClient createClient(final SphereClientConfig config) { final HttpClient httpClient = defaultHttpClient(); final SphereAccessTokenSupplier tokenSupplier = SphereAccessTokenSupplier.ofAutoRefresh(config, httpClient, false); return SphereClient.of(config, defaultHttpClient(), tokenSupplier); }