@fencyai/react 0.1.27 → 0.1.29

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.
@@ -5,13 +5,6 @@ export declare const FencyContextValue: import("react").Context<FencyContext | u
5
5
  * Expects a promise that resolves to a Fency instance
6
6
  */
7
7
  export declare function FencyProvider({ fency, children }: FencyProviderProps): import("react/jsx-runtime").JSX.Element | null;
8
- export interface FencyOptions {
9
- publishableKey: string;
10
- endpoint?: string;
11
- }
12
- /**
13
- * Context for Fency instance
14
- */
15
8
  export interface FencyContext {
16
9
  fency: FencyInstance;
17
10
  loading: boolean;
@@ -10,13 +10,17 @@ export function FencyProvider({ fency, children }) {
10
10
  const [fencyInstance, setFencyInstance] = useState(null);
11
11
  const [loading, setLoading] = useState(true);
12
12
  const [error, setError] = useState(null);
13
+ console.log('new fency provider');
13
14
  useEffect(() => {
14
15
  fency
15
16
  .then((instance) => {
17
+ console.log('fency instance', instance);
16
18
  setFencyInstance(instance);
17
19
  setLoading(false);
18
20
  })
19
21
  .catch((err) => {
22
+ console.log('fency error', err);
23
+ console.error(err);
20
24
  setError(err);
21
25
  setLoading(false);
22
26
  });
@@ -30,6 +34,7 @@ export function FencyProvider({ fency, children }) {
30
34
  loading,
31
35
  error,
32
36
  };
37
+ console.log('error', error);
33
38
  if (error) {
34
39
  return _jsxs("div", { children: ["Fency error: ", error.message] });
35
40
  }
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { FencyProvider } from './FencyProvider';
2
2
  export { useChatCompletion } from './hooks/useChatCompletion';
3
3
  export { useFency } from './hooks/useFency';
4
- export type { FencyContext, FencyOptions, FencyProviderProps, } from './FencyProvider';
4
+ export type { FencyContext, FencyProviderProps } from './FencyProvider';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fencyai/react",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "> TODO: description",
5
5
  "author": "staklau <steinaageklaussen@gmail.com>",
6
6
  "homepage": "",
@@ -35,7 +35,7 @@
35
35
  "zod": "^4.0.5"
36
36
  },
37
37
  "devDependencies": {
38
- "@fencyai/js": "^0.1.27",
38
+ "@fencyai/js": "^0.1.29",
39
39
  "@types/jest": "^29.5.11",
40
40
  "@types/node": "^20.10.5",
41
41
  "@types/react": "^18.2.45",
@@ -44,8 +44,8 @@
44
44
  "typescript": "^5.3.3"
45
45
  },
46
46
  "peerDependencies": {
47
- "@fencyai/js": "^0.1.27",
47
+ "@fencyai/js": "^0.1.29",
48
48
  "react": ">=16.8.0"
49
49
  },
50
- "gitHead": "f81e837f2842f6e78b40cf508c32fdde48cc7983"
50
+ "gitHead": "a258f0148d6115750bf28a6828319477012517fb"
51
51
  }