diff --git a/packages/vue-sdk/README.md b/packages/vue-sdk/README.md index 3c4f6eb8..e0e4fcb9 100644 --- a/packages/vue-sdk/README.md +++ b/packages/vue-sdk/README.md @@ -24,7 +24,7 @@ import { BucketProvider } from "@bucketco/vue-sdk"; @@ -46,23 +46,6 @@ const huddle = useFeature("huddle"); ``` @@ -84,7 +67,7 @@ A number of special attributes exist: ```vue @@ -126,26 +109,9 @@ The `` initializes the Bucket SDK, fetches features and starts l - `publishableKey` is used to connect the provider to an _environment_ on Bucket. Find your `publishableKey` under [environment settings](https://app.bucket.co/envs/current/settings/app-environments) in Bucket, - `company`, `user` and `otherContext` make up the _context_ that is used to determine if a feature is enabled or not. `company` and `user` contexts are automatically transmitted to Bucket servers so the Bucket app can show you which companies have access to which features etc. + > [!Note] > If you specify `company` and/or `user` they must have at least the `id` property, otherwise they will be ignored in their entirety. You should also supply anything additional you want to be able to evaluate feature targeting against, -- `fallbackFeatures`: A list of strings which specify which features to consider enabled if the SDK is unable to fetch features. Can be provided in two formats: - - ```ts - // Simple array of feature keys - fallbackFeatures={["feature1", "feature2"]} - - // Or with configuration overrides - fallbackFeatures: { - "feature1": true, // just enable the feature - "feature2": { // enable with configuration - key: "variant-a", - payload: { - limit: 100, - mode: "test" - } - } - } - ``` - `timeoutMs`: Timeout in milliseconds when fetching features from the server, - `staleWhileRevalidate`: If set to `true`, stale features will be returned while refetching features in the background, @@ -167,7 +133,7 @@ BucketProvider lets you define a template to be shown while BucketProvider is in ```vue ``` +See the reference docs for details. + ### `useTrack()` `useTrack()` lets you send custom events to Bucket. Use this whenever a user _uses_ a feature. diff --git a/packages/vue-sdk/dev/plain/App.vue b/packages/vue-sdk/dev/plain/App.vue index 5210efad..e535c509 100644 --- a/packages/vue-sdk/dev/plain/App.vue +++ b/packages/vue-sdk/dev/plain/App.vue @@ -20,7 +20,7 @@ const publishableKey = import.meta.env.VITE_PUBLISHABLE_KEY || "";