Make integrations values more permissive

This commit is contained in:
Colin King
2019-01-09 16:54:33 -08:00
parent e836acc75a
commit 501329c62e
2 changed files with 13 additions and 5 deletions

View File

@@ -135,22 +135,28 @@ function testGroup(): void {
function testIntegrations(): void {
analytics.track({
event: 'Upgraded Membershipt',
event: 'Upgraded Membership',
userId: '97234974',
integrations: {
'All': false,
'Vero': true,
'Google Analytics': false
'Google Analytics': false,
'AppsFlyer': {
'appsflyer_id': 'example-id'
}
}
});
analytics.track({
event: 'Upgraded Membershipt',
event: 'Upgraded Membership',
userId: '97234974',
integrations: {
'All': false,
'Vero': true,
'Google Analytics': false
'Google Analytics': false,
'AppsFlyer': {
'appsflyer_id': 'example-id'
}
}
}, (err, data) => {
if (err) {

View File

@@ -33,9 +33,11 @@ declare namespace AnalyticsNode {
}
interface Integrations {
[index: string]: boolean;
[integration_name: string]: IntegrationValue
}
type IntegrationValue = boolean | { [integration_key: string] : any };
export class Analytics {
constructor(writeKey: string, opts?: {
flushAt?: number,