From e9025fdaa5183ac757a0153dcf1c47aa91fe686b Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Thu, 26 Jun 2025 21:48:07 +0200 Subject: [PATCH 1/7] remove unused imports --- apps/events/src/routes/authenticate-success.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/events/src/routes/authenticate-success.tsx b/apps/events/src/routes/authenticate-success.tsx index cc46c424..b546efec 100644 --- a/apps/events/src/routes/authenticate-success.tsx +++ b/apps/events/src/routes/authenticate-success.tsx @@ -1,7 +1,5 @@ -import { Connect } from '@graphprotocol/hypergraph'; import { useHypergraphApp } from '@graphprotocol/hypergraph-react'; import { createFileRoute, useNavigate } from '@tanstack/react-router'; -import * as Effect from 'effect/Effect'; import { useEffect } from 'react'; export const Route = createFileRoute('/authenticate-success')({ From e098ae6b72f83805dd04dbd4da0306a796bf53a6 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Thu, 26 Jun 2025 21:49:34 +0200 Subject: [PATCH 2/7] add vercel config for SPA setup to connect --- apps/connect/vercel.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 apps/connect/vercel.json diff --git a/apps/connect/vercel.json b/apps/connect/vercel.json new file mode 100644 index 00000000..3a48e56b --- /dev/null +++ b/apps/connect/vercel.json @@ -0,0 +1,3 @@ +{ + "rewrites": [{ "source": "/(.*)", "destination": "/" }] +} From a140c958a0f414e8c749ec1e24208d84b6b50707 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Thu, 26 Jun 2025 22:01:39 +0200 Subject: [PATCH 3/7] use correct privy app id --- apps/connect/.env.development | 1 + apps/connect/.env.production | 7 ++++--- apps/connect/src/Boot.tsx | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/connect/.env.development b/apps/connect/.env.development index 1a660658..9ee365fd 100644 --- a/apps/connect/.env.development +++ b/apps/connect/.env.development @@ -2,6 +2,7 @@ VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN="http://localhost:3030" VITE_HYPERGRAPH_CHAIN="geo-testnet" VITE_HYPERGRAPH_API_URL="https://hypergraph-v2-testnet.up.railway.app/graphql" VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-test-zc16z3tcvf.t.conduit.xyz" +VITE_PRIVY_APP_ID="cmbhnmo1x000bla0mxudtd8z9" # VITE_HYPERGRAPH_CHAIN="geogenesis" # VITE_HYPERGRAPH_API_URL="https://hypergraph-v2.up.railway.app/graphql" # VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-genesis-h0q2s21xx8.t.conduit.xyz" diff --git a/apps/connect/.env.production b/apps/connect/.env.production index 40aed403..3d095aac 100644 --- a/apps/connect/.env.production +++ b/apps/connect/.env.production @@ -1,4 +1,5 @@ VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN="https://syncserver.hypergraph.thegraph.com" -VITE_HYPERGRAPH_CHAIN="geogenesis" -VITE_HYPERGRAPH_API_URL="https://hypergraph-v2.up.railway.app/graphql" -VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-genesis-h0q2s21xx8.t.conduit.xyz" +VITE_HYPERGRAPH_CHAIN="geo-testnet" +VITE_HYPERGRAPH_API_URL="https://hypergraph-v2-testnet.up.railway.app/graphql" +VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-test-zc16z3tcvf.t.conduit.xyz" +VITE_PRIVY_APP_ID="cmcccikza007bjy0niawgutl0" \ No newline at end of file diff --git a/apps/connect/src/Boot.tsx b/apps/connect/src/Boot.tsx index 40b74582..71a27fc5 100644 --- a/apps/connect/src/Boot.tsx +++ b/apps/connect/src/Boot.tsx @@ -47,7 +47,7 @@ export function Boot() { return ( Date: Thu, 26 Jun 2025 22:04:52 +0200 Subject: [PATCH 4/7] provide default storage --- apps/events/src/Boot.tsx | 7 +------ apps/next-example/src/components/providers.tsx | 2 +- packages/hypergraph-react/src/HypergraphAppContext.tsx | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/apps/events/src/Boot.tsx b/apps/events/src/Boot.tsx index 8c3229ba..3cfd05e5 100644 --- a/apps/events/src/Boot.tsx +++ b/apps/events/src/Boot.tsx @@ -15,12 +15,7 @@ declare module '@tanstack/react-router' { export function Boot() { return ( - + ); diff --git a/apps/next-example/src/components/providers.tsx b/apps/next-example/src/components/providers.tsx index 3fa2a518..332613b7 100644 --- a/apps/next-example/src/components/providers.tsx +++ b/apps/next-example/src/components/providers.tsx @@ -7,7 +7,7 @@ export default function Providers({ children }: { children: React.ReactNode }) { const storage = typeof window !== 'undefined' ? window.localStorage : (undefined as unknown as Storage); return ( - + {children} ); diff --git a/packages/hypergraph-react/src/HypergraphAppContext.tsx b/packages/hypergraph-react/src/HypergraphAppContext.tsx index 880304a9..cd9e4f52 100644 --- a/packages/hypergraph-react/src/HypergraphAppContext.tsx +++ b/packages/hypergraph-react/src/HypergraphAppContext.tsx @@ -215,7 +215,7 @@ export function useHypergraphAuth() { } export type HypergraphAppProviderProps = Readonly<{ - storage: Identity.Storage; + storage?: Identity.Storage; syncServerUri?: string; chainId?: number; children: ReactNode; @@ -227,7 +227,7 @@ export type HypergraphAppProviderProps = Readonly<{ // b) If identity is not found, create a new identity // (and store it in the sync server) export function HypergraphAppProvider({ - storage, + storage = localStorage, syncServerUri = 'https://syncserver.hypergraph.thegraph.com', chainId = Connect.GEO_TESTNET.id, children, From 0e9cb5d1e3932929a78606f8bb7985740cd0aaa1 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Thu, 26 Jun 2025 22:08:58 +0200 Subject: [PATCH 5/7] bump version --- packages/hypergraph-react/package.json | 2 +- packages/hypergraph/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hypergraph-react/package.json b/packages/hypergraph-react/package.json index a7f6ae4e..6c9859c8 100644 --- a/packages/hypergraph-react/package.json +++ b/packages/hypergraph-react/package.json @@ -1,6 +1,6 @@ { "name": "@graphprotocol/hypergraph-react", - "version": "0.0.3", + "version": "0.0.4", "description": "React implementation and additional functionality, components, and hooks for the hypergraph SDK framework", "keywords": ["Web3", "Local-First", "Knowledge Graph", "Graph Protocol", "react"], "publishConfig": { diff --git a/packages/hypergraph/package.json b/packages/hypergraph/package.json index 96f8bdea..281dab09 100644 --- a/packages/hypergraph/package.json +++ b/packages/hypergraph/package.json @@ -1,6 +1,6 @@ { "name": "@graphprotocol/hypergraph", - "version": "0.0.3", + "version": "0.0.4", "description": "SDK for building performant, type-safe, local-first dapps on top of The Graph ecosystem knowledge graphs.", "publishConfig": { "access": "public", From 8db5ee81245723a3aa929c07358366fd21499f3d Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Thu, 26 Jun 2025 22:15:00 +0200 Subject: [PATCH 6/7] fix SSR build --- .../hypergraph-react/src/HypergraphAppContext.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/hypergraph-react/src/HypergraphAppContext.tsx b/packages/hypergraph-react/src/HypergraphAppContext.tsx index cd9e4f52..db5d672c 100644 --- a/packages/hypergraph-react/src/HypergraphAppContext.tsx +++ b/packages/hypergraph-react/src/HypergraphAppContext.tsx @@ -221,13 +221,22 @@ export type HypergraphAppProviderProps = Readonly<{ children: ReactNode; mapping: Mapping; }>; + +const mockStorage = { + getItem(_key: string) { + return null; + }, + setItem(_key: string, _value: string) {}, + removeItem(_key: string) {}, +}; + // 1) a) Get session token from local storage, or // b) Auth with the sync server // 2) a)Try to get identity from the sync server, or // b) If identity is not found, create a new identity // (and store it in the sync server) export function HypergraphAppProvider({ - storage = localStorage, + storage = typeof window !== 'undefined' ? localStorage : mockStorage, syncServerUri = 'https://syncserver.hypergraph.thegraph.com', chainId = Connect.GEO_TESTNET.id, children, From 7bec47218e0977da4f375ed6b74d50691e86939c Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Thu, 26 Jun 2025 22:15:40 +0200 Subject: [PATCH 7/7] bump version --- packages/hypergraph-react/package.json | 2 +- packages/hypergraph/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hypergraph-react/package.json b/packages/hypergraph-react/package.json index 6c9859c8..c0469371 100644 --- a/packages/hypergraph-react/package.json +++ b/packages/hypergraph-react/package.json @@ -1,6 +1,6 @@ { "name": "@graphprotocol/hypergraph-react", - "version": "0.0.4", + "version": "0.0.5", "description": "React implementation and additional functionality, components, and hooks for the hypergraph SDK framework", "keywords": ["Web3", "Local-First", "Knowledge Graph", "Graph Protocol", "react"], "publishConfig": { diff --git a/packages/hypergraph/package.json b/packages/hypergraph/package.json index 281dab09..d62dd5ce 100644 --- a/packages/hypergraph/package.json +++ b/packages/hypergraph/package.json @@ -1,6 +1,6 @@ { "name": "@graphprotocol/hypergraph", - "version": "0.0.4", + "version": "0.0.5", "description": "SDK for building performant, type-safe, local-first dapps on top of The Graph ecosystem knowledge graphs.", "publishConfig": { "access": "public",