File: examples/Angular/main.ts

Recommend this page to a friend!
  Classes of Arturs Sosins   Countly Web SDK   examples/Angular/main.ts   Download  
File: examples/Angular/main.ts
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Countly Web SDK
Track site accesses and errors the Countly API
Author: By
Last change: minification and tabbings (#475)
[Web] Add warnings to all SDK example apps that would check if propper credentials have been set or it still has the defaults. (#473)

* feat: add warning for defaults

* Delete screenlog.0

* feat: warn

* Update index.html

* Update index.js

* Update example_ga_adapter.html

* Update example_async.html

* Update example_apm_async.html
Date: 1 month ago
Size: 878 bytes
 

Contents

Class file image Download
import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; import Countly from 'countly-sdk-web'; window.Countly = Countly; const COUNTLY_SERVER_KEY = "https://your.server.ly"; const COUNTLY_APP_KEY = "YOUR_APP_KEY"; if (COUNTLY_APP_KEY === "YOUR_APP_KEY" || COUNTLY_SERVER_KEY === "https://your.server.ly") { console.warn("Please do not use default set of app key and server url") } // initializing countly with params Countly.init({ app_key: COUNTLY_APP_KEY, url: COUNTLY_SERVER_KEY, //your server goes here debug: true }); Countly.track_sessions(); if (environment.production) { enableProdMode(); } platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.error(err));