space-react-client 0.2.5 → 0.3.1

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 CHANGED
@@ -134,15 +134,15 @@ You can then inject a Pricing Token from your backend:
134
134
 
135
135
  ```tsx
136
136
  import { useEffect } from 'react';
137
- import { usePricingToken } from 'space-react-client';
137
+ import { useTokenService } from 'space-react-client';
138
138
 
139
139
  export function InjectTokenFromServer() {
140
- const tokenService = usePricingToken();
140
+ const tokenService = useTokenService();
141
141
 
142
142
  useEffect(() => {
143
143
  fetch('/api/my-pricing-token')
144
144
  .then(res => res.text()) // token as string
145
- .then(token => tokenService.updatePricingToken(token))
145
+ .then(token => tokenService.update(token))
146
146
  .catch(console.error);
147
147
  }, [tokenService]);
148
148
 
@@ -173,7 +173,7 @@ export function InjectTokenFromServer() {
173
173
  - **`useSpaceClient(): SpaceClient`**
174
174
  Access the connected SPACE client. Throws if not available.
175
175
 
176
- - **`usePricingToken(): TokenService`**
176
+ - **`useTokenService(): TokenService`**
177
177
  Manage Pricing Tokens in context. Available even if live connection is disabled.
178
178
 
179
179
  ---
@@ -230,8 +230,8 @@ All events (except `synchronized` and `error`) include the following object:
230
230
 
231
231
  **Methods:**
232
232
 
233
- - `updatePricingToken(token)` — Validates & stores a pricing token.
234
- - `getPricingToken()` — Return parsed token payload.
233
+ - `update(token)` — Validates & stores a pricing token.
234
+ - `getPayload()` — Return parsed token payload.
235
235
  - `evaluateFeature(featureId)` — Returns `true | false | null`.
236
236
 
237
237
  Token expectations: