@bucketco/react-sdk
Advanced tools
Comparing version 1.1.0 to 2.0.0
@@ -7,5 +7,2 @@ import { default as React, ReactNode } from 'react'; | ||
type BucketFeatures = keyof (keyof Features extends never ? Record<string, boolean> : Features); | ||
export type FeaturesResult = { | ||
[k in BucketFeatures]?: boolean; | ||
}; | ||
export type BucketProps = BucketContext & { | ||
@@ -38,5 +35,9 @@ publishableKey: string; | ||
export declare function useFeature(key: BucketFeatures): { | ||
isLoading: boolean; | ||
isLoading: true; | ||
isEnabled: boolean; | ||
track: () => void; | ||
track: () => Promise<Response | undefined> | undefined; | ||
} | { | ||
isLoading: false; | ||
track: () => Promise<Response | undefined> | undefined; | ||
readonly isEnabled: boolean; | ||
}; | ||
@@ -52,3 +53,3 @@ /** | ||
*/ | ||
export declare function useTrack(): (eventName: string, attributes?: Record<string, any> | undefined) => void; | ||
export declare function useTrack(): (eventName: string, attributes?: Record<string, any> | null) => Promise<Response | undefined> | undefined; | ||
/** | ||
@@ -69,3 +70,3 @@ * Returns a function to open up the feedback form | ||
*/ | ||
export declare function useRequestFeedback(): (opts: Omit<RequestFeedbackOptions, "userId" | "companyId">) => void; | ||
export declare function useRequestFeedback(): (options: Omit<RequestFeedbackOptions, "userId">) => void | undefined; | ||
/** | ||
@@ -88,3 +89,3 @@ * Returns a function to manually send feedback collected from a user. | ||
*/ | ||
export declare function useSendFeedback(): (opts: Omit<Feedback, "userId" | "companyId">) => void; | ||
export declare function useSendFeedback(): (opts: Omit<Feedback, "userId" | "companyId">) => Promise<Response | undefined> | undefined; | ||
export {}; |
{ | ||
"name": "@bucketco/react-sdk", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"license": "MIT", | ||
@@ -31,3 +31,3 @@ "repository": { | ||
"dependencies": { | ||
"@bucketco/browser-sdk": "1.1.0", | ||
"@bucketco/browser-sdk": "2.0.0", | ||
"canonical-json": "^0.0.4" | ||
@@ -62,3 +62,3 @@ }, | ||
}, | ||
"gitHead": "640fec6372802a8ca9d3aee4cbfb615077f4f11b" | ||
"gitHead": "bc964a2eb0703766b50a8c554bda0e69c3fc88ea" | ||
} |
@@ -37,3 +37,3 @@ # Bucket React SDK | ||
Add the `BucketProvider` context provider to your application. | ||
This will initialize the Bucket SDK, fetch features and start listening for Live Satisfaction events. | ||
This will initialize the Bucket SDK, fetch features and start listening for automated feedback survey events. | ||
@@ -128,3 +128,3 @@ **Example:** | ||
`useRequestFeedback()` returns a function that lets you open up a dialog to ask for feedback on a specific feature. | ||
See [Live Satisfaction](https://docs.bucket.co/product-handbook/live-satisfaction) for how to do this automatically, without code. | ||
See [Automated Feedback Surveys](https://docs.bucket.co/product-handbook/live-satisfaction) for how to do this automatically, without code. | ||
@@ -142,3 +142,3 @@ ```ts | ||
See https://github.com/bucketco/bucket-javascript-sdk/blob/main/packages/tracking-sdk/FEEDBACK.md#manual-feedback-collection for more information on `requestFeedback` | ||
See https://github.com/bucketco/bucket-javascript-sdk/blob/main/packages/browser-sdk/FEEDBACK.md#manual-feedback-collection for more information on `requestFeedback` | ||
@@ -162,4 +162,8 @@ ### `useSendFeedback()` | ||
See https://github.com/bucketco/bucket-javascript-sdk/blob/main/packages/tracking-sdk/FEEDBACK.md#manual-feedback-collection for more information on `sendFeedback` | ||
See https://github.com/bucketco/bucket-javascript-sdk/blob/main/packages/browser-sdk/FEEDBACK.md#manual-feedback-collection for more information on `sendFeedback` | ||
# Content Security Policy (CSP) | ||
See https://github.com/bucketco/bucket-javascript-sdk/blob/main/packages/browser-sdk/README.md#content-security-policy-csp for info on using Bucket React SDK with CSP | ||
# License | ||
@@ -166,0 +170,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3422
170
342576
+ Added@bucketco/browser-sdk@2.0.0(transitive)
- Removed@bucketco/browser-sdk@1.1.0(transitive)
Updated@bucketco/browser-sdk@2.0.0