@unleash/proxy-client-vue 0.1.5 → 0.1.6
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/README.md +12 -10
- package/dist/FlagProvider.vue.d.ts +1 -1
- package/dist/useUnleashContext.d.ts +2 -2
- package/dist/useUnleashProvide.d.ts +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Unleash Vue SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Unleash is a private, secure, and scalable [feature management platform](https://www.getunleash.io/) built to reduce the risk of releasing new features and accelerate software development. This Frontend Vue SDK is designed to help you integrate with Unleash and evaluate feature flags inside your application.
|
|
4
|
+
|
|
5
|
+
You can use this client with [Unleash Enterprise](https://www.getunleash.io/pricing?utm_source=readme&utm_medium=vue) or [Unleash Open Source](https://github.com/Unleash/unleash).
|
|
4
6
|
|
|
5
7
|
## Usage note
|
|
6
8
|
|
|
7
|
-
This library is meant to be used with [Unleash Edge](https://github.com/Unleash/unleash-edge/)
|
|
9
|
+
This library is meant to be used with [Unleash Edge](https://github.com/Unleash/unleash-edge/) or the [Unleash front-end API](https://docs.getunleash.io/reference/front-end-api).
|
|
8
10
|
|
|
9
11
|
It is **not** compatible with the Unleash client API.
|
|
10
12
|
|
|
@@ -12,7 +14,7 @@ It is **not** compatible with the Unleash client API.
|
|
|
12
14
|
|
|
13
15
|
```bash
|
|
14
16
|
npm install @unleash/proxy-client-vue
|
|
15
|
-
|
|
17
|
+
# or
|
|
16
18
|
yarn add @unleash/proxy-client-vue
|
|
17
19
|
```
|
|
18
20
|
|
|
@@ -27,8 +29,8 @@ import { plugin as unleashPlugin } from '@unleash/proxy-client-vue'
|
|
|
27
29
|
import App from './App.vue'
|
|
28
30
|
|
|
29
31
|
const config = {
|
|
30
|
-
url: 'https://HOSTNAME/
|
|
31
|
-
clientKey: '
|
|
32
|
+
url: 'https://HOSTNAME/api/frontend',
|
|
33
|
+
clientKey: 'FRONTEND_TOKEN',
|
|
32
34
|
refreshInterval: 15,
|
|
33
35
|
appName: 'your-app-name',
|
|
34
36
|
}
|
|
@@ -66,8 +68,8 @@ import { plugin as unleashPlugin } from '@unleash/proxy-client-vue'
|
|
|
66
68
|
import App from './App.vue'
|
|
67
69
|
|
|
68
70
|
const config = {
|
|
69
|
-
url: 'https://HOSTNAME/
|
|
70
|
-
clientKey: '
|
|
71
|
+
url: 'https://HOSTNAME/api/frontend',
|
|
72
|
+
clientKey: 'FRONTEND_TOKEN',
|
|
71
73
|
refreshInterval: 15,
|
|
72
74
|
appName: 'your-app-name',
|
|
73
75
|
}
|
|
@@ -86,7 +88,7 @@ import { FlagProvider, UnleashClient } from '@unleash/proxy-client-vue'
|
|
|
86
88
|
|
|
87
89
|
const config = {
|
|
88
90
|
url: 'https://UNLEASH-INSTANCE/api/frontend',
|
|
89
|
-
clientKey: '
|
|
91
|
+
clientKey: 'FRONTEND_TOKEN',
|
|
90
92
|
refreshInterval: 15,
|
|
91
93
|
appName: 'your-app-name',
|
|
92
94
|
}
|
|
@@ -102,7 +104,7 @@ const client = new UnleashClient(config)
|
|
|
102
104
|
|
|
103
105
|
### Deferring client start
|
|
104
106
|
|
|
105
|
-
By default, the Unleash client will start polling
|
|
107
|
+
By default, the Unleash client will start polling for toggles immediately when the `FlagProvider` component renders. You can delay the polling by:
|
|
106
108
|
|
|
107
109
|
- setting the `startClient` prop to `false`
|
|
108
110
|
- passing a client instance to the `FlagProvider`
|
|
@@ -15,7 +15,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
15
15
|
}, {
|
|
16
16
|
context: import("vue").ToRefs<{
|
|
17
17
|
on: (event: string, args_0: Function, args_1: any) => UnleashClient | undefined;
|
|
18
|
-
updateContext: (context: import("unleash-proxy-client").
|
|
18
|
+
updateContext: (context: import("unleash-proxy-client").IMutableContext) => Promise<void>;
|
|
19
19
|
isEnabled: (name: string) => boolean | undefined;
|
|
20
20
|
getVariant: (name: string) => import("unleash-proxy-client").IVariant | undefined;
|
|
21
21
|
client: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const useUnleashContext: () => ((context:
|
|
1
|
+
import { IMutableContext } from 'unleash-proxy-client';
|
|
2
|
+
declare const useUnleashContext: () => ((context: IMutableContext) => Promise<void>) | undefined;
|
|
3
3
|
export default useUnleashContext;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UnleashClient, IConfig,
|
|
1
|
+
import { UnleashClient, IConfig, IMutableContext } from 'unleash-proxy-client';
|
|
2
2
|
export interface IProvideOptions {
|
|
3
3
|
config?: IConfig;
|
|
4
4
|
unleashClient?: UnleashClient;
|
|
@@ -7,7 +7,7 @@ export interface IProvideOptions {
|
|
|
7
7
|
declare function useUnleashProvide({ config, unleashClient, startClient }: IProvideOptions): {
|
|
8
8
|
context: import("vue").ToRefs<{
|
|
9
9
|
on: (event: string, args_0: Function, args_1: any) => UnleashClient | undefined;
|
|
10
|
-
updateContext: (context:
|
|
10
|
+
updateContext: (context: IMutableContext) => Promise<void>;
|
|
11
11
|
isEnabled: (name: string) => boolean | undefined;
|
|
12
12
|
getVariant: (name: string) => import("unleash-proxy-client").IVariant | undefined;
|
|
13
13
|
client: {
|
|
@@ -15,7 +15,7 @@ declare function useUnleashProvide({ config, unleashClient, startClient }: IProv
|
|
|
15
15
|
isEnabled: (toggleName: string) => boolean;
|
|
16
16
|
getVariant: (toggleName: string) => import("unleash-proxy-client").IVariant;
|
|
17
17
|
updateToggles: () => Promise<void>;
|
|
18
|
-
updateContext: (context:
|
|
18
|
+
updateContext: (context: IMutableContext) => Promise<void>;
|
|
19
19
|
getContext: () => {
|
|
20
20
|
appName: string;
|
|
21
21
|
environment?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unleash/proxy-client-vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Vue interface for working with Unleash",
|
|
5
5
|
"main": "./dist/index.umd.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
],
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/Unleash/
|
|
15
|
+
"url": "https://github.com/Unleash/unleash-vue-sdk"
|
|
16
16
|
},
|
|
17
17
|
"exports": {
|
|
18
18
|
".": {
|