diff --git a/packages/vue-sdk/README.md b/packages/vue-sdk/README.md index e0e4fcb9..f83f9252 100644 --- a/packages/vue-sdk/README.md +++ b/packages/vue-sdk/README.md @@ -40,15 +40,18 @@ If using Nuxt, wrap `` in ``. `` onl ``` +See [useFeature()](#usefeature) for a full example + ## Setting `user` and `company` Bucket determines which features are active for a given `user`, `company`, or `otherContext`. @@ -70,7 +73,9 @@ A number of special attributes exist: :publishable-key="publishableKey" :user="{ id: 'user_123', name: 'John Doe', email: 'john@acme.com' }" :company="{ id: 'acme_inc', plan: 'pro' }" -> +> + + ``` To retrieve features along with their targeting information, use `useFeature(key: string)` hook (described in a section below). @@ -149,26 +154,40 @@ If you want more control over loading screens, `useIsLoading()` returns a Ref void, // send a track event when the feature is used + requestFeedback: (...) => void // open up a feedback dialog + config: {key: string, payload: any}, // remote configuration for this feature + isLoading: boolean // if you want to manage loading state at the feature level +} +``` + +Example: ```vue