init(config)

2.0.0及以上版本插件使用init配置各种属性,例如apikey

  1. fundebug.init({
  2. apikey: "API-KEY"
  3. });

TypeScript

init方法的TypeScript定义如下:

  1. export function init(config: IConfigs): undefined;
  2. interface IConfigs {
  3. apikey: string;
  4. appversion?: string;
  5. releasestage?: string;
  6. user?: IUser;
  7. metaData?: object;
  8. callback?: ICallback;
  9. setHttpBody?: boolean;
  10. httpTimeout?: number;
  11. filters?: object[];
  12. silent?: boolean;
  13. silentDev?: boolean;
  14. silentResource?: boolean;
  15. silentHttp?: boolean;
  16. silentWebsocket?: boolean;
  17. silentConsole?: boolean;
  18. silentPerformance?: boolean;
  19. sampleRate?: number;
  20. domain?: string;
  21. }