{
    "Amplify Analytics Configuration": {
        "prefix": "Analytics.configure",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "Analytics.configure({",
                "\t// OPTIONAL - disable Analytics if true",
                "\tdisabled: ${1:false},",
                "\t// OPTIONAL - Allow recording session events. Default is true.",
                "\tautoSessionRecord: ${2:true},\n",
                "\tAWSPinpoint: {",
                "\t\t// OPTIONAL -  Amazon Pinpoint App Client ID",
                "\t\tappId: ${3:'XXXXXXXXXXabcdefghij1234567890ab'},",
                "\t\t// OPTIONAL -  Amazon service region",
                "\t\tregion: ${4:'XX-XXXX-X'},",
                "\t\t// OPTIONAL -  Customized endpoint",
                "\t\tendpointId: ${5:'XXXXXXXXXXXX'},",
                "\t\t// OPTIONAL - client context",
                "\t\tclientContext: {",
                "\t\t\tclientId: ${6:'xxxxx'},",
                "\t\t\tappTitle: ${7:'xxxxx'},",
                "\t\t\tappVersionName: ${8:'xxxxx'},",
                "\t\t\tappVersionCode: ${9:'xxxxx'},",
                "\t\t\tappPackageName: ${10:'xxxxx'},",
                "\t\t\tplatform: ${11:'xxxxx'},",
                "\t\t\tplatformVersion: ${12:'xxxxx'},",
                "\t\t\tmodel: ${13:'xxxxx'},",
                "\t\t\tmake: ${14:'xxxxx'},",
                "\t\t\tlocale: ${15:'xxxxx'},",
                "\t\t},\n",
                "\t\t// Buffer settings used for reporting analytics events.\n",
                "\t\t// OPTIONAL - The buffer size for events in number of items.",
                "\t\tbufferSize: ${16:1000},\n",
                "\t\t// OPTIONAL - The interval in milliseconds to perform a buffer check and flush if necessary.",
                "\t\tflushInterval: ${17:5000}, // 5s\n",
                "\t\t// OPTIONAL - The number of events to be deleted from the buffer when flushed.",
                "\t\tflushSize: ${18:100},\n",
                "\t\t// OPTIONAL - The limit for failed recording retries.",
                "\t\tresendLimit: ${19:5}",
                "\t}",
                "});"
        ]
    },
    "Analytics Custom Tracking Event": {
        "prefix": "Analytics.record",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "Analytics.record({",
                "\tname: ${1:'albumVisit'},",
                "\tattributes: {},",
                "\tmetrics: { ${2:minutesListened: 30} }",
            "});"
        ]
    },
    "Analytics.disable": {
        "prefix": "Analytics.disable",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "Analytics.disable"
        ]
    },
    "Analytics.enable": {
        "prefix": "Analytics.enable",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "Analytics.enable"
        ]
    },
    "Analytics Authentication Event": {
        "prefix": "Analytics.record",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "Analytics.record({",
                "\tname: ${1:'_userauth.event'}",
            "});"
        ]
    },
    "Analytics Update User Attributes": {
        "prefix": "Analytics.updateEndpoint",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "Analytics.updateEndpoint({",
                "\t// Customized userId",
                "\tUserId: ${1:'XXXXXXXXXXXX'},",
                "\t// User attributes",
                "\tAttributes: {",
                    "\t\t${2:interests: ['football', 'basketball', 'AWS']}",
                    "\t\t// ...",
                "\t},",
                "\t// Custom user attributes",
                "\tUserAttributes: {",
                    "\t\t${3:hobbies: ['piano', 'hiking']}",
                    "\t\t// ...",
                "\t}",
            "})"
        ]
    },
    "AWSKinesis": {
        "prefix": "AWSKinesis",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "AWSKinesis: {",
                "\t// OPTIONAL - Amazon Kinesis service region",
                "\tregion: ${1:'XX-XXXX-X'},",
                "\t// OPTIONAL - The buffer size for events in number of items.",
                "\tbufferSize: ${2:1000},",
                "\t// OPTIONAL - The number of events to be deleted from the buffer when flushed.",
                "\tflushSize: ${3:100},",
                "\t// OPTIONAL - The interval in milliseconds to perform a buffer check and flush if necessary.",
                "\tflushInterval: ${4:5000}, // 5s",
                "\t// OPTIONAL - The limit for failed recording retries.",
                "\tresendLimit: ${5:5}",
            "}"
        ]
    },
    "Kinesis Record": {
        "prefix": "Analytics.record",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "Analytics.record({",
                "\tdata: {",
                    "\t\t// The data blob to put into the record",
                "\t},",
                "\t// OPTIONAL",
                "\tpartitionKey: ${1:'myPartitionKey'},",
                "\tstreamName: ${2:'myKinesisStream'}",
            "}, 'AWSKinesis');"
        ]
    },
    "AnalyticsProvider": {
        "prefix": "AnalyticsProvider",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "AnalyticsProvider {",
                "\t// category and provider name",
                "\tstatic category = ${1:'Analytics'};",
                "\tstatic providerName = ${2:'MyAnalytics'};\n",
                "\t// you need to implement these four methods",
                "\t// configure your provider",
                "\tconfigure(config: object): object;\n",
                "\t// record events and returns true if succeeds",
                "\trecord(params: object): Promise<boolean>;\n",
                "\t// return 'Analytics';",
                "\tgetCategory(): string;\n",
                "\t// return the name of your provider",
                "\tgetProvider(): string;",
            "}"
        ]
    },
    "addPluggable": {
        "prefix": "addPluggable",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "addPluggable"
        ]
    },
    "getPluggable": {
        "prefix": "getPluggable",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "getPluggable"
        ]
    },
    "removePluggable": {
        "prefix": "removePluggable",
        "scope": "javascript,javascriptreact,typescript",
        "body": [
            "removePluggable"
        ]
    }
}