analytics-client
Advanced tools
Comparing version 0.4.0 to 0.4.1-roman-config-40195f6433c2dddc41a53fe8069f45ecde309092
@@ -7,2 +7,7 @@ # Change Log | ||
# v0.4.1 | ||
## (2020-03-26) | ||
* Adapt config to analytics-backend API [Roman Mazur] | ||
## 0.4.0 - 2020-03-18 | ||
@@ -9,0 +14,0 @@ |
@@ -16,3 +16,3 @@ "use strict"; | ||
if (config.endpoint) { | ||
amplConfig.apiEndpoint = config.endpoint; | ||
amplConfig.apiEndpoint = config.endpoint + "/amplitude"; | ||
} | ||
@@ -19,0 +19,0 @@ amplConfig.cookieExpiration = config_1.COOKIES_TTL_DAYS; |
@@ -22,1 +22,8 @@ "use strict"; | ||
}); | ||
test('amplitude config', function () { | ||
var client = client_1.createClient({ | ||
projectName: 'balena-test', | ||
endpoint: "some.host", | ||
}); | ||
expect(client.amplitude().options.apiEndpoint).toEqual('some.host/amplitude'); | ||
}); |
const client = analyticsClient.createClient({ | ||
endpoint: 'localhost:3001/amplitude', | ||
endpoint: 'localhost:3001', | ||
projectName: 'balena-test', | ||
@@ -4,0 +4,0 @@ amplitude: { |
{ | ||
"name": "analytics-client", | ||
"version": "0.4.0", | ||
"version": "0.4.1-roman-config-40195f6433c2dddc41a53fe8069f45ecde309092", | ||
"description": "Convenient builders to compose analytics tools", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -49,3 +49,3 @@ import amplitude from 'amplitude-js'; | ||
if (config.endpoint) { | ||
amplConfig.apiEndpoint = config.endpoint; | ||
amplConfig.apiEndpoint = `${config.endpoint}/amplitude`; | ||
} | ||
@@ -52,0 +52,0 @@ amplConfig.cookieExpiration = COOKIES_TTL_DAYS; |
@@ -24,1 +24,9 @@ import { createClient } from '../src/client'; | ||
}); | ||
test('amplitude config', () => { | ||
const client = createClient({ | ||
projectName: 'balena-test', | ||
endpoint: `some.host`, | ||
}); | ||
expect(client.amplitude().options.apiEndpoint).toEqual('some.host/amplitude'); | ||
}); |
Sorry, the diff of this file is too big to display
221778
1381