@formo/analytics 1.11.9-alpha.1 → 1.11.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formo/analytics",
3
- "version": "1.11.9-alpha.1",
3
+ "version": "1.11.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/getformo/sdk.git"
@@ -14,6 +14,7 @@ interface IFormoAnalytics {
14
14
  */
15
15
  init(
16
16
  apiKey: string,
17
+ projectId: string,
17
18
  options?: Options
18
19
  ): Promise<FormoAnalytics>;
19
20
 
@@ -62,6 +63,7 @@ export class FormoAnalytics implements IFormoAnalytics {
62
63
 
63
64
  private constructor(
64
65
  public readonly apiKey: string,
66
+ public readonly projectId: string,
65
67
  public options: Options = {}
66
68
  ) {
67
69
  this.config = {
@@ -77,12 +79,13 @@ export class FormoAnalytics implements IFormoAnalytics {
77
79
 
78
80
  static async init(
79
81
  apiKey: string,
82
+ projectId: string,
80
83
  options?: Options
81
84
  ): Promise<FormoAnalytics> {
82
85
  const config = {
83
86
  token: apiKey,
84
87
  };
85
- const instance = new FormoAnalytics(apiKey, options);
88
+ const instance = new FormoAnalytics(apiKey, projectId, options);
86
89
  instance.config = config;
87
90
 
88
91
  return instance;
@@ -447,8 +450,8 @@ export class FormoAnalytics implements IFormoAnalytics {
447
450
  sessionStorage.removeItem(this.walletAddressSessionKey);
448
451
  }
449
452
 
450
- init(apiKey: string, options: Options): Promise<FormoAnalytics> {
451
- const instance = new FormoAnalytics(apiKey, options);
453
+ init(apiKey: string, projectId: string, options: Options): Promise<FormoAnalytics> {
454
+ const instance = new FormoAnalytics(apiKey, projectId, options);
452
455
  return Promise.resolve(instance);
453
456
  }
454
457
 
@@ -19,6 +19,7 @@ export const FormoAnalyticsContext = createContext<FormoAnalytics | undefined>(
19
19
  export const FormoAnalyticsProvider = ({
20
20
  apiKey,
21
21
  options,
22
+ projectId,
22
23
  disabled,
23
24
  children,
24
25
  }: FormoAnalyticsProviderProps) => {
@@ -61,7 +62,7 @@ export const FormoAnalyticsProvider = ({
61
62
 
62
63
  // Initialize FormoAnalytics
63
64
  try {
64
- const sdkInstance = await FormoAnalytics.init(apiKey, options);
65
+ const sdkInstance = await FormoAnalytics.init(apiKey, projectId, options);
65
66
  setSdk(sdkInstance);
66
67
  console.log('FormoAnalytics SDK initialized successfully');
67
68
  } catch (error) {
package/src/types/base.ts CHANGED
@@ -8,6 +8,7 @@ export interface Options {
8
8
 
9
9
  export interface FormoAnalyticsProviderProps {
10
10
  apiKey: string;
11
+ projectId: string;
11
12
  options?: Options;
12
13
  disabled?: boolean;
13
14
  children: React.ReactNode;