@geophrase/react 1.6.1 → 1.7.0

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
@@ -78,6 +78,7 @@ const { open } = useGeophrase({
78
78
  | `key` | `string` | **Conditional** | Your secret [Geophrase API key](https://geophrase.com/docs/api-keys). **Required if `mode` is `'client'`.** Omit if using server mode. |
79
79
  | `theme` | `string` | Optional | `'light'`, `'dark'`, or `'system'`. Defaults to `'system'`. |
80
80
  | `orderId` | `string` | Optional | Your internal reference ID for this checkout session. |
81
+ | `noteForAgent` | `string` | Optional | Note shown to your delivery agent, never to the customer. Client mode only; notes over 300 characters are cut. It is sent from the customer's device, so the customer can change it; send payment instructions, such as cash to collect, from your server or the dashboard. In server mode, send `note_for_agent` with your [resolve call](https://geophrase.com/docs/resolve-endpoint). |
81
82
  | `phone` | `string` | Optional | The customer's 10-digit phone number (pre-fills the widget). |
82
83
  | `onSuccess` | `function` | **Yes** | Called upon completion. Returns an `Address` object (`mode: 'client'`) or a `Token` object (`mode: 'server'`). |
83
84
  | `onError` | `function` | Optional | Called if the API fails or a network error occurs. Returns an `Error` object. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geophrase/react",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "React & Next.js hook for the Geophrase address picker. Drop-in widget that captures structured Indian addresses with coordinates to reduce RTO.",
5
5
  "license": "MIT",
6
6
  "author": "Geophrase",
@@ -44,7 +44,7 @@
44
44
  "react": ">=16.8.0"
45
45
  },
46
46
  "dependencies": {
47
- "@geophrase/core": "^1.6.0"
47
+ "@geophrase/core": "^1.7.0"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"
@@ -30,6 +30,7 @@ export const useGeophrase = (options = {}) => {
30
30
  theme: options.theme,
31
31
  key: options.key,
32
32
  orderId: options.orderId,
33
+ noteForAgent: options.noteForAgent,
33
34
  phone: options.phone,
34
35
  onSuccess: (data) => {
35
36
  if (savedCallbacks.current.onSuccess) savedCallbacks.current.onSuccess(data);
@@ -52,7 +53,7 @@ export const useGeophrase = (options = {}) => {
52
53
  }
53
54
  };
54
55
  // Include mode and theme in the dependency array so the instance rebuilds if they change state
55
- }, [options.keyId, options.mode, options.theme, options.key, options.orderId, options.phone]);
56
+ }, [options.keyId, options.mode, options.theme, options.key, options.orderId, options.noteForAgent, options.phone]);
56
57
 
57
58
  const open = useCallback(() => {
58
59
  if (geoInstance.current) {