Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-amplitude-hooks

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-amplitude-hooks - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

src/components/Amplitude.tsx

7

dist/components/Amplitude.d.ts
import * as PropTypes from "prop-types";
import * as React from "react";
import { Callback } from "amplitude-js";
declare type Props = {

@@ -11,3 +10,3 @@ children: Function | React.ReactNode;

export declare function useAmplitude(instanceName?: string): {
logEvent: (eventType: string, eventProperties?: any, callback?: Callback | undefined) => void;
logEvent: (eventType: string, eventProperties?: object, callback?: any) => void;
instrument: <T extends Function>(eventType: string, func: T) => T;

@@ -17,4 +16,4 @@ eventProperties: any;

};
export default function Amplitude(props: Props): JSX.Element;
export default namespace Amplitude {
export declare function Amplitude(props: Props): JSX.Element;
export declare namespace Amplitude {
var propTypes: {

@@ -21,0 +20,0 @@ children: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;

@@ -19,3 +19,3 @@ "use strict";

if (instanceName === void 0) { instanceName = "$default_instance"; }
var _a = AmplitudeProvider_1.useAmplitudeContext(), amplitudeInstance = _a.amplitudeInstance, inheritedProperties = _a.eventProperties;
var _b = AmplitudeProvider_1.useAmplitudeContext(), amplitudeInstance = _b.amplitudeInstance, inheritedProperties = _b.eventProperties;
function logEvent(eventType, eventProperties, callback) {

@@ -44,3 +44,3 @@ if (eventProperties === void 0) { eventProperties = {}; }

eventProperties: inheritedProperties,
amplitudeInstance: amplitudeInstance,
amplitudeInstance: amplitudeInstance
};

@@ -55,3 +55,3 @@ }

}
exports.default = Amplitude;
exports.Amplitude = Amplitude;
Amplitude.propTypes = {

@@ -62,3 +62,3 @@ children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),

instanceName: PropTypes.string,
userProperties: PropTypes.object,
userProperties: PropTypes.object
};

@@ -17,4 +17,4 @@ import * as PropTypes from "prop-types";

export declare function useAmplitudeContext(): AmplitudeContextType;
export default function AmplitudeProvider(props: Props): JSX.Element;
export default namespace AmplitudeProvider {
export declare function AmplitudeProvider(props: Props): JSX.Element;
export declare namespace AmplitudeProvider {
var propTypes: {

@@ -21,0 +21,0 @@ amplitudeInstance: PropTypes.Validator<object>;

@@ -7,3 +7,3 @@ "use strict";

exports.AmplitudeContext = React.createContext({
eventProperties: {},
eventProperties: {}
});

@@ -30,10 +30,10 @@ function useAmplitudeContext() {

amplitudeInstance: props.amplitudeInstance,
eventProperties: {},
eventProperties: {}
} }, props.children));
}
exports.default = AmplitudeProvider;
exports.AmplitudeProvider = AmplitudeProvider;
AmplitudeProvider.propTypes = {
amplitudeInstance: PropTypes.object.isRequired,
apiKey: PropTypes.string,
userId: PropTypes.string,
userId: PropTypes.string
};
import * as PropTypes from "prop-types";
import * as React from "react";
declare type Props = {
debounceInterval?: number;
eventProperties: object | Function;

@@ -10,4 +9,4 @@ eventType: string;

};
export default function LogOnChange(props: Props): {} | null;
export default namespace LogOnChange {
export declare function LogOnChange(props: Props): {} | null;
export declare namespace LogOnChange {
var propTypes: {

@@ -14,0 +13,0 @@ debounceInterval: PropTypes.Requireable<number>;

@@ -13,3 +13,3 @@ "use strict";

}
exports.default = LogOnChange;
exports.LogOnChange = LogOnChange;
LogOnChange.propTypes = {

@@ -20,3 +20,3 @@ debounceInterval: PropTypes.number,

instanceName: PropTypes.string,
value: PropTypes.any,
value: PropTypes.any
};

@@ -0,1 +1,2 @@

import * as PropTypes from "prop-types";
import * as React from "react";

@@ -8,3 +9,12 @@ declare type Props = {

};
export default function LogOnMount(props: Props): {} | null;
export declare function LogOnMount(props: Props): {} | null;
export declare namespace LogOnMount {
var propTypes: {
debounceInterval: PropTypes.Requireable<number>;
eventProperties: PropTypes.Requireable<object>;
eventType: PropTypes.Validator<string>;
instanceName: PropTypes.Requireable<string>;
value: PropTypes.Requireable<any>;
};
}
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var PropTypes = require("prop-types");
var React = require("react");

@@ -12,2 +13,9 @@ var Amplitude_1 = require("./Amplitude");

}
exports.default = LogOnMount;
exports.LogOnMount = LogOnMount;
LogOnMount.propTypes = {
debounceInterval: PropTypes.number,
eventProperties: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
eventType: PropTypes.string.isRequired,
instanceName: PropTypes.string,
value: PropTypes.any
};

@@ -1,4 +0,4 @@

export { default as Amplitude } from './components/Amplitude';
export { default as AmplitudeProvider } from './components/AmplitudeProvider';
export { default as LogOnChange } from './components/LogOnChange';
export { default as LogOnMount } from './components/LogOnMount';
export { LogOnMount } from "./components/LogOnMount";
export { LogOnChange } from "./components/LogOnChange";
export { Amplitude, useAmplitude } from "./components/Amplitude";
export { AmplitudeProvider } from "./components/AmplitudeProvider";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var LogOnMount_1 = require("./components/LogOnMount");
exports.LogOnMount = LogOnMount_1.LogOnMount;
var LogOnChange_1 = require("./components/LogOnChange");
exports.LogOnChange = LogOnChange_1.LogOnChange;
var Amplitude_1 = require("./components/Amplitude");
exports.Amplitude = Amplitude_1.default;
exports.Amplitude = Amplitude_1.Amplitude;
exports.useAmplitude = Amplitude_1.useAmplitude;
var AmplitudeProvider_1 = require("./components/AmplitudeProvider");
exports.AmplitudeProvider = AmplitudeProvider_1.default;
var LogOnChange_1 = require("./components/LogOnChange");
exports.LogOnChange = LogOnChange_1.default;
var LogOnMount_1 = require("./components/LogOnMount");
exports.LogOnMount = LogOnMount_1.default;
exports.AmplitudeProvider = AmplitudeProvider_1.AmplitudeProvider;
{
"name": "react-amplitude-hooks",
"version": "0.0.3",
"description": "React Amplitude Components with hook support",
"main": "dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc"
"author": {
"name": "David Koblas"
},
"files": [
"dist"
],
"types": "dist/index.d.ts",
"peerDependencies": {
"react": "^16.6.0-0"
"bundleDependencies": false,
"dependencies": {
"prop-types": "^15.7.2"
},
"author": "David Koblas",
"license": "ISC",
"description": "React Amplitude Components with hook support",
"devDependencies": {
"@types/amplitude-js": "^4.4.1",
"@types/prop-types": "^15.7.0",
"@types/react": "^16.8.13",

@@ -25,3 +17,14 @@ "prettier": "^1.17.0",

},
"dependencies": {}
"license": "ISC",
"main": "dist/index.js",
"name": "react-amplitude-hooks",
"peerDependencies": {
"react": "^16.6.0-0"
},
"scripts": {
"build": "tsc",
"test": "echo \"Error: no test specified\" && exit 1"
},
"types": "index.d.ts",
"version": "0.0.4"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc